changeset 5:34fd1e46aee0

first release
author Walter Cruz <walter@waltercruz.com>
date Fri, 16 May 2008 17:02:51 -0300
parents ba17f1f62e8f
children 2f8ba13b99f1
files feed2twitter/README feed2twitter/docs/default.cfg.sample feed2twitter/docs/release.howto feed2twitter/feed2twitter.egg-info/PKG-INFO feed2twitter/feed2twitter/__init__.py feed2twitter/scripts/feed2twitter feed2twitter/setup.py
diffstat 7 files changed, 67 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/feed2twitter/README	Fri May 16 17:02:51 2008 -0300
@@ -0,0 +1,21 @@
+To install feed2twitter:
+install python-twitter:
+  http://code.google.com/p/python-twitter/
+installfeedparser:
+  http://www.feedparser.org/
+
+install it with: python setup.py install
+
+Running:
+  you need to set your feed and your twitter account.
+  Create a folder under the $HOME of the user that will run feed2twitter called .feed2twitter
+  Add a file called default.cfg, like this:
+
+[global]
+url = http://example.com/rss
+username = twitter_user
+password = twitter_password
+
+Run it with the command feed2twitter. It will update your twitter with your latest 5 posts, hour by hour
+
+Kudos to Gleicon da Silveira (http://zenmachine.wordpress.com/about/), that give me a idea of the code in a post of his blog
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/feed2twitter/docs/default.cfg.sample	Fri May 16 17:02:51 2008 -0300
@@ -0,0 +1,4 @@
+[global]
+url = http://example.com/rss
+username = twitter_user
+password = twitter_password
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/feed2twitter/docs/release.howto	Fri May 16 17:02:51 2008 -0300
@@ -0,0 +1,16 @@
+How to make a release:
+
+- change version in setup.py
+- commit
+
+- build tar.gz, egg for 2.4 and 2.5 and send them to pypi.
+  On my system (Debian unstable):
+    python2.4 setup.py egg_info -RDb "" register bdist_egg upload
+    python2.5 setup.py egg_info -RDb "" sdist bdist_egg upload
+
+  or, you could also set an alias up like this:
+    python setup.py alias -u release egg_info -RDb ""
+
+  On older systems, you might need to upload the files manually to Pypi.
+
+- announce release on my site (http://waltercruz.com)
--- a/feed2twitter/feed2twitter.egg-info/PKG-INFO	Fri May 16 16:47:38 2008 -0300
+++ b/feed2twitter/feed2twitter.egg-info/PKG-INFO	Fri May 16 17:02:51 2008 -0300
@@ -14,6 +14,18 @@
         
         install it with: python setup.py install
         
+        Running:
+        you need to set your feed and your twitter account.
+        Create a folder under the $HOME of the user that will run feed2twitter called .feed2twitter
+        Add a file called default.cfg, like this:
+        
+        [global]
+        url = http://example.com/rss
+        username = twitter_user
+        password = twitter_password
+        
+        Run it with the command feed2twitter. It will update your twitter with your latest 5 posts, hour by hour
+        
 Keywords: twitter feed
 Platform: UNKNOWN
 Classifier: Intended Audience :: Developers
--- a/feed2twitter/feed2twitter/__init__.py	Fri May 16 16:47:38 2008 -0300
+++ b/feed2twitter/feed2twitter/__init__.py	Fri May 16 17:02:51 2008 -0300
@@ -14,7 +14,6 @@
 # You should have received a copy of the GNU Affero General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-from __future__ import with_statement
 import feedparser, pickle, os, sys, twitter, urllib
 from ConfigParser import ConfigParser, NoOptionError
 import readrss
@@ -35,7 +34,6 @@
         oldItems=pItems=0
         for it in list(items):
             txt=it["title"][0:114] +" "+tiny(it["link"])
-            #print txt
             try:
                 status = self.twApi.PostUpdate(txt)
                 self.rss.updateLastRead(it)
@@ -60,11 +58,12 @@
     c = ConfigParser()
     configfile =os.path.expanduser('~/.feed2twitter/default.cfg')
     try:
-        with open(configfile, 'r') as fd:
-            c.readfp(fd)
+        fd =  open(configfile, 'r')
     except IOError:
         print >>sys.stderr, "File %s not found" % configfile
         sys.exit(2)
+    c.readfp(fd)
+
 
     url = c.get("global", "url").strip()
     username = c.get("global", "username").strip()
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/feed2twitter/scripts/feed2twitter	Fri May 16 17:02:51 2008 -0300
@@ -0,0 +1,9 @@
+#!/usr/bin/env python
+import feed2twitter
+import time
+
+if __name__=="__main__":
+    while 1:
+      feed2twitter.update()
+      time.sleep(3600)
+
--- a/feed2twitter/setup.py	Fri May 16 16:47:38 2008 -0300
+++ b/feed2twitter/setup.py	Fri May 16 17:02:51 2008 -0300
@@ -10,6 +10,8 @@
       classifiers=[
       "Intended Audience :: Developers",
       "Programming Language :: Python",
+      "Environment :: Console",
+      "Development Status :: 3 - Alpha"
       ],
       keywords='twitter feed',
       author='Walter Cruz',