Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # -*- coding: utf-8 -*-
- # libnotame.py para el uso de notame con python
- # patron url del api http://www.meneame.net/api/newpost.php?user=usuario&key=clave&text=texto
- # gnu/gpl v3 Patxi
- import urllib
- class Nota():
- user = ""
- apikey = ""
- nota = ""
- url = "http://www.meneame.net/api/newpost.php?"
- def setUser(self, user):
- self.user = user
- def setApikey(self, apikey):
- self.apikey = apikey
- def setNota(self, nota):
- self.nota = nota
- def send(self):
- nota_data = urllib.urlencode({'user': self.user, 'key': self.apikey, 'text': self.nota})
- self.url = self.url + nota_data
- print self.url
- feedback = urllib.urlopen(self.url).read()
- return feedback
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement