Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
twitterize by Jacob Harris http://www.nycruby.org/
== DESCRIPTION:
Twitterize is a quick and dirty hack I did in a few hours to play with the Twitter API (seriously, there are no tests and I'm sure there is code crude enough in there to make you recant any friendship we might have). It allows you to take any number of RSS feeds and post them to one or more Twitter accounts. An example of this is how various RSS feeds from the New York Times are sent to twitter accounts nytimes, nyt_arts, nyt_biz, etc. This is accomplished via a command-line script that requires a separate configuration file (see below). Since Twitter is a rapidly growing (read somewhat flaky) service, twitterize also uses a database to store twitters to be posted and recover later if twitter is down. This also allows the app to retain feed GUIDs and avoid duplicate posts.
Twitterize has two execution stages. In the first stage, it checks if any feeds are ready to be refreshed, downloads new articles, and saves outgoing twitter messages in the database. In the second stage, it posts any new twitters up to their corresponding accounts. Both stages are independent and can be thought of as a producer-consumer model. When twitterize finishes phase two, it exits. Rather than run continuously as a daemon, I think it's much better if you execute twitterize every 5-30 minutes via a cronjob.
== FEATURES/PROBLEMS:
== SYNOPSIS:
twitterize --config-file ~/twitter.yml --verbose --lookback 12h
This illustrates some of the salient operational points of twitterize. It takes a config file (see below for format). You can turn on some manner of useless chattering with the --verbose option. The lookback option is actually quite useful, specifying it tells twitter to log feed items earlier that the lookback window, but not post them to Twitter (the h,m,d modifiers are for hours/minutes/days). This is good if you add a bunch of new feeds and don't want to send stories in your blog feed from 2 months ago to Twitter (keep it fresh). I suppose this could be a config-file option, but it was useful for me to make it a command-line option when testing out the NY Times feeds.
== REQUIREMENTS:
== INSTALL:
sudo gem install twitterize
setup the database. Here is the schema for MySQL for instance:
CREATE TABLE feeds
(
id
int(11) NOT NULL auto_increment,
name
varchar(255) default NULL,
url
text,
user
varchar(255) default NULL,
password
varchar(255) default NULL,
last_check
datetime default NULL,
next_check
datetime default NULL,
interval
int(11) default NULL,
PRIMARY KEY (id
)
) DEFAULT CHARSET=utf8
CREATE TABLE items
(
id
int(11) NOT NULL auto_increment,
feed_id
int(11) default NULL,
title
varchar(255) default NULL,
guid
varchar(255) default NULL,
link
text,
twitter
varchar(255) default NULL,
published_at
datetime default NULL,
posted
tinyint(4) default '0',
posted_at
datetime default NULL,
PRIMARY KEY (id
)
) DEFAULT CHARSET=utf8
create a twitter.yml config file somewhere. This looks like the following
database: active record settings
feeds: name1: url: the url of the feed user: the twitter account to post to password: the twitter password interval: (secs, optional) to force updates, despite ttl (default: 30 mins) name2, etc.
You can add more feeds to the config.yml at a later time and they will be added to the internal database with twitterize runs next.
== LICENSE:
(The MIT License)
Copyright (c) 2007 FIX
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
FAQs
Unknown package
We found that twitterize demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.