sanacl / rsstotwitter Goto Github PK
View Code? Open in Web Editor NEWrsstotwitter is a very simple tool to update twitter accounts from RSS feeds. It is written in python and licensed under GPL
rsstotwitter is a very simple tool to update twitter accounts from RSS feeds. It is written in python and licensed under GPL
RSS to twitter * rsstotwitter is a very simple tool to update twitter accounts from RSS feeds. It is written in python and licensed under GPL * Author: Luis Cañas Díaz <[email protected]> * rsstotwitter.py default.cfg * example of configuration file. (the parameter include_title is optional) [Configuration] consumer_key=your_consumer_key consumer_secret=your_consumer_secret access_token_key=your_access_token_key access_token_secret=your_access_token_secret feed_url=http://libresoft.es/ourplanet/daily-planet/RSS include_title=Some text before the entry content here * need help?: rsstotwitter.py --help * dependencies python-twitter and its dependencies * Problems with the authentication? Do you see the error “Error, the message could not be posted!”? During September 2010 the twitter platform cut off the basic authentication method and now it is mandatory to use oAuth. If that’s your case you’ll need to install the latest version of python-twitter, see instructions below. * Installing the last version of python-twitter - To install it have a look at the instructions here , I’ve tested the a936121dfd commit (Aug 24 2010) * Setting up the twitter access data - Go to the url http://twitter.com/oauth_clients and register a new application. You’ll have to create it with a name application, use your imagination - In the previous step you get a consumer key and a consumer secret. Use them in the python script get_access_token.py which is included in the python-twitter code - After executing the script get_access_token.py you’ll need to follow the instructions shown by the script to get a pincode from twitter - You should have now the access_token_key and the access_token_secret parameters. Include them in the configuration file
Find below the error:
/etc/cron.hourly/rsstotwitter_pool:
/etc/rsstotwitter/ls-news
/etc/rsstotwitter/ls-planet
/etc/rsstotwitter/osor-case_studies
/etc/rsstotwitter/osor-communities
/etc/rsstotwitter/osor-community_blogs
send: 'POST /1/statuses/update.json HTTP/1.1\r\nAccept-Encoding: identity\r\nContent-Length: 334\r\nHost: api.twitter.com\r\nContent-Type: application/x-www-form-urlencoded\r\nConnection: close\r\nUser-Agent: Python-urllib/2.5\r\n\r\n'
send: 'status=Estonia%3A%20Eesti%20vaade%20osor.eu-s%20http%3A%2F%2Ftinyurl.com%2F34axj9c&oauth_version=1.0&oauth_token=46066476-RK1vX4ZZvVYbYpBJ1qG7XPVKJreBQyZEDQAhGum8Y&oauth_nonce=91274851&oauth_timestamp=1288095423&oauth_signature=Z5rhM%2BBsOxKbsPRoVMOfjGQHPBA%3D&oauth_consumer_key=xnGWqlLVTwmzA2ANrqvQQ&oauth_signature_method=HMAC-SHA1'
reply: 'HTTP/1.1 403 Forbidden\r\n'
header: Date: Tue, 26 Oct 2010 12:16:33 GMT
header: Server: hi
header: Status: 403 Forbidden
header: X-Transaction: 1288095393-85879-43653
header: Last-Modified: Tue, 26 Oct 2010 12:16:33 GMT
header: X-Runtime: 0.05545
header: Content-Type: application/json; charset=utf-8
header: Content-Length: 73
header: Pragma: no-cache
header: X-Revision: DEV
header: Expires: Tue, 31 Mar 1981 05:00:00 GMT
header: Cache-Control: no-cache, no-store, must-revalidate, pre-check=0, post-check=0
header: Set-Cookie: k=193.147.51.200.1288095393500107; path=/; expires=Tue, 02-Nov-10 12:16:33 GMT; domain=.twitter.com
header: Set-Cookie: guest_id=12880953938943266; path=/; expires=Thu, 25 Nov 2010 12:16:33 GMT
header: Set-Cookie: lang=en; path=/
header: Set-Cookie: _twitter_sess=BAh7CToMY3NyZl9pZCIlODRkYWE1OTNkMzhmMjVmODU0N2Y5NGEwNjU5MjNl%250AMTI6D2NyZWF0ZWRfYXRsKwhv6HfoKwE6B2lkIiVjNjdmYTAyNjlmOGRkNDlh%250ANmJhYjljNDlkNDJjOTYxMSIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6%250ARmxhc2g6OkZsYXNoSGFzaHsABjoKQHVzZWR7AA%253D%253D--c5d3f2e100bc3643ff2c065b2aba9011bdde8923; domain=.twitter.com; path=/
header: Vary: Accept-Encoding
header: Connection: close
Traceback (most recent call last):
File "/usr/local/bin/rsstotwitter.py", line 291, in
main()
File "/usr/local/bin/rsstotwitter.py", line 287, in main
sent_messages = s.send()
File "/usr/local/bin/rsstotwitter.py", line 131, in send
if self.post2twitter(i):
File "/usr/local/bin/rsstotwitter.py", line 166, in post2twitter
status = self.api.PostUpdate(text)
File "/var/lib/python-support/python2.5/twitter.py", line 2158, in PostUpdate
File "/var/lib/python-support/python2.5/twitter.py", line 2943, in _CheckForTwitterError
twitter.TwitterError: Status is a duplicate.
/etc/rsstotwitter/osor-events
/etc/rsstotwitter/osor-new_projects
/etc/rsstotwitter/osor-news
/etc/rsstotwitter/osor-project_releases
luis@ma-bu:~/Trabajo/repos/rsstotwitter$ ./rsstotwitter.py --help Traceback (most recent call last): File "./rsstotwitter.py", line 263, in main() File "./rsstotwitter.py", line 234, in main config.readfp(open(cfg_file)) IOError: [Errno 2] No such file or directory: '--help'
I've read in the python-twitter issues tracket that Twitter has changed its authorization method from "username and password" to using oauth which requires a key and a secret. The python-twitter module with that feature is not stable yet and they recommend us to move to http://code.google.com/p/oauth-python-twitter/ while waiting for the new python-twitter release.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.