ejemplos y setup.py
authordanigm <dani@danigm.net>
Sat, 7 Mar 2009 18:03:43 +0000 (19:03 +0100)
committerdanigm <dani@danigm.net>
Sat, 7 Mar 2009 18:03:43 +0000 (19:03 +0100)
examples.py [new file with mode: 0644]
setup.py [new file with mode: 0644]

diff --git a/examples.py b/examples.py
new file mode 100644 (file)
index 0000000..2cd5fa0
--- /dev/null
@@ -0,0 +1,25 @@
+from pysweetter import Sweetter
+
+s = Sweetter()
+# Last 10 comments
+comments = s.get_last_comments('index')
+
+# Last danigm 10 comments
+comments = s.get_last_comments('danigm')
+# Last danigm and danigm's followings 10 comments
+comments = s.get_last_followings('danigm')
+# Last replies to danigm 
+comments = s.get_replies('danigm')
+
+for comment in comments:
+    text = comment.sweet
+    username = comment.user
+    avatar_uri = comment.avatar
+    created = comment.created
+    print text, username, avatar_uri, created
+
+# To post or set location you need to be authenticated
+my_api_key = 'asdfasdfasfq23l4rq'
+# Your apikey is in http://sweetter.net/edit_profile
+s.autenticate(my_api_key)
+s.post('my text in sweetter')
diff --git a/setup.py b/setup.py
new file mode 100644 (file)
index 0000000..27247c2
--- /dev/null
+++ b/setup.py
@@ -0,0 +1,13 @@
+#!/usr/bin/env python
+
+from distutils.core import setup
+
+setup(name='pysweetter',
+      version='1.0',
+      description='Sweetter XMLRPC python module',
+      author='Daniel Garcia',
+      author_email='dani@danigm.net',
+      url='http://sweetter.net',
+      py_modules = ['pysweetter'],
+     )
+