logo.png

PumpTweet

2013-10-17

A Python script that cross posts from a Pump.io server to Twitter. The source is hosted on GitHub.

Pump.png

Overview

If you aren't familiar with pump.io, take a look at https://microca.st/. Try it out and see what you think! This script is for people already using a pump service (like microca.st, but there are many others, and you can run your own). On Pump.io, there are many different kinds of activities. Here, we only look for notes, which are essentially regular blog entries. We find notes from our pump account, shorten them, make a URL to the original note (very useful if it's a long note), and post the short version as a tweet on Twitter. In other words, we're cross-posting from Pump to Twitter. Other pump activities (such as comments, likes, dislikes, and following new people) are excluded from this, because it's not obvious at face value what, if anything, among them would be of interest to a reader on Twitter. This program is designed to be run as a cron job on a regular basis (for example, every fifteen minutes). The more frequent the cron job, the more up to date your cross posts are. There are other programs that do similar things (for example, http://brdcst.it/). If you enjoy using them, by all means continue to do so! On the other hand, if this script fits your needs, wonderful. If you browse the source code, you'll notice that (a) it's really short, because all the hard work was done by the wonderful people who wrote the dependencies, and (b) it's simple, so you can make changes if you like.

Example

Pump notes can be of any length, but tweets are limited to 140 characters. This program crops notes either (1) at the first line break or (2) as close as it can to 140 characters while still leaving room for a link to the original note. Here are some examples.

Example pump #1.

Have a great weekend, everyone!

Example tweet #1. The URL is a link to the original note.

Have a great weekend, everyone! http://ur1.ca/fislx

Example pump #2.

I have a technical question about cooling fans. My processor on my new machine is an i7. I'm using a SilverStone AR-01 heat sink. The heat sink is...

Example tweet #2. Only the first line of the note is retained.

I have a technical question about cooling fans.… http://ur1.ca/fihk8

Downloads

Twitter.png