I have had my matrix StatusNet instance up for quite some time. This instance consists of six accounts that mostly spit out random notices that are pulled via various bash scripts. I decided it was time to recreate some of this for pump.io.
After installing pump.io, there is a handful of cli tools in /pump.io/bin. With these scripts, you can register a user, post a note, follow another user, etc... Using the scripts, I've created a few (at the time of this writing, there are 10) accounts to post random posts of useful (or is it useless...) tidbits.
Off to the commandline...
The first step for me after deciding on what crap to pull, is to write a bash script to pull the said (sed?) crap. Using the good ol' tools curl, cat, grep, sed, awk, etc... I'll parse whatever page down to the actual message that will be sent.
For the rest of this, I am assuming that:
- the /pump.io/bin directory is in my $PATH.
- That registration is open for the target pump.
Also, since pump.io is currently being heavily developed, any of this may not work quite the same in the future.
First, your "app" (in this case, the commandline) will need to be registered with the site, to do so, use the pump-register-app script. If you open the script (or attempt to run it without any arguments) it'll list what options that it requires. To register my commandline, I used this command:
pump-register-app -s pump.jpope.org -P 443 -t CLI
The next step is to create the user or, if the user has already been created, to authorize the user. To create a user:
pump-register-user -s pump.jpope.org -P 443 -u username -p password
or to authorize existing user:
pump-authorize -s pump.jpope.org -P 443 -u username
The pump-authorize script will return a URL that will need to be opened so that the verifier value can be copied and pasted to complete the authorization.
These scripts will create the directory
~/.pump.d which will contain all of the needed OAUTH tokens that will be required to post a note. Posting a note is now as simple as:
pump-post-note -s pump.jpope.org -P 443 -u username -n "Hello World!"
And with this, scripting a random note becomes quite easy. Here are a few of the scripts that power my current list of bots living in BashScriptVille:
Once the bash scripts are working the way I want, I'll add entries to cron so that they will post at random intervals. One thing to note about the pump-post-note script is that currently, it'll only post notes to your followers. Also, for ease of use outside of bash scripts if you only post to one pump, you could alias the pump-post-note script so that you don't need to add the server/port
And that's it, scripted pump.io bots. :)
Sidenote: Once identi.ca makes the switch to pump.io, I will likely be closing my matrix instance. I foresee more activity taking place within the pumpiverse as opposed to the few various StatusNet instances that will be left. Also, my webserver will gladly take any relief it can get from running fewer php/mysql based webapps.
unrelated to the post but: how the $%&@ to follow a pumpio instance via rss? There is no autodiscovery/no rss icon. Is it something yet to be implemented?
I usually stalk statusnet users like that :P
Thanks for clearing it out!
Though news for me :(