Piping scheduled strings through to twitter
July 7, 2012 3:33 PM   Subscribe

Trying to pipe individual lines from a big text file through to twitter, at scheduled times.

I've got a big text file of lines I've taken from old digitised newspapers, which I've started tweeting. I'd really like to automate the process. How can I take this file, set half a dozen times for daily posting, and leave it to its business?

(Free!) existing tools would be awesome, as I'm no programmer, but I could probably edit an existing script if need be.

A few things:
  • I'd really like it to delete the lines as it goes, or otherwise mark something as done, so I know where I'm up to.
  • I have several entries that are too long for a single tweet, so I've marked them as [1] and [2] - can I make them go out together instead of waiting for the next scheduled tweet?
  • I'm still adding to the file, so I need to make sure it won't break if I edit it.
On a Mac with Lion, in case there's anything built in I can use.

posted by roobot to Computers & Internet (9 answers total) 3 users marked this as a favorite
You can bulk-upload scheduled tweets into HootSuite.
posted by Hollywood Upstairs Medical College at 3:40 PM on July 7, 2012 [1 favorite]

You're not Tweets of Old, are you?
posted by Cash4Lead at 4:15 PM on July 7, 2012

You can post using curl

Post a message to twitter:

$ curl -u myusername:mypassword -S -d status="Everything is OK" http://twitter.com/statuses/update.xml

Post a message to twitter (https):

$ curl -u myusername:mypassword -d "status=Everything is OK" https://twitter.com/statuses/update.xml
posted by Lanark at 4:40 PM on July 7, 2012

Social oomph dot com works for scheduling tweets for free.
posted by manicure12 at 4:45 PM on July 7, 2012

Using curl with basic auth as in Lanark's example no longer works, and hasn't for almost 2 years. Twitter requires authentication with OAuth now, which makes seemingly simple tasks like this difficult. You'll have to find an existing tool specifically for tweeting and scheduling tweets, if programming is not your thing. I wish I had something to recommend, but everything I know of requires non-trivial programming knowledge.
posted by WasabiFlux at 5:05 PM on July 7, 2012

I actually wrote a command line utility to automate posting to Twitter. It supports OAuth and would probably work just fine for you. If you're interested, contact me via MeMail and I'll send you the program and the documentation.
posted by DWRoelands at 5:08 PM on July 7, 2012

The easiest way to tweet from the command-line is probably the "t" gem, though that will probably require a modern ruby installation on your Mac, which can be a pain to set up.

With "t" installed, you could run something like this (I haven't tested this) from Terminal.app:
$ cat mytweets.txt | while read tweet
> do
> t update "$tweet"
> sleep 3600
> done
The sleep 3600 above means wait an hour (60 minutes * 60 seconds = 3600) between tweets.

Having said all that, if I were doing this, I wouldn't write my own - I'd use HootSuite or something similar.
posted by bbuda at 5:23 PM on July 7, 2012

Response by poster: Pretty sure the Hootsuite bulk upload thing is just for paying customers.

Thanks DWRowlands, I'll drop you a line.

And I wish, Cash4Lead. Those guys know what they're doing. :)
posted by roobot at 7:03 PM on July 7, 2012

Buffer exists just to do this.

Twitter disabled basic authentication, but you can still do things the old way if you do so through SuperTweet.
posted by 23 at 1:04 AM on July 27, 2012

« Older Baconmayo   |   Masters degree question. Newer »
This thread is closed to new comments.