Updated Laconica curl Script

A few weeks back the shell script I use, via an AppleScript wrapper and Quicksilver, to post to Identi.ca stopped working. After some chatter with the Laconi.ca developers and contributors, it turns out there was a change to the site’s login form. I missed the communication of this change. There is now a token that needs to be handled correctly for security and to help prevent accidental double clicking.

My first impulse when I examined the form source was to expand the curl calls to try to handle the token. The recommended approach, however, is to use the Twitter compatible API. This approach will remain more simple and consistent over time whereas the form may go through further evolution to keep browser access safe.

So here is the current script that I use for anyone else who may have run afoul of this change:

#!/bin/bash

new_message=${1}

curl \
--basic \
--user user:password \
--data "status=${new_message}" \
--output /dev/null \
http://identi.ca/api/statuses/update.xml

2 Replies to “Updated Laconica curl Script”

  1. Not fair – I just created a PHP script to post updates to identi.ca a few hours ago – because your last script didn’t work for me :-). Nice job with the new script.

    To all user’s who are copy-pasting the code, you have to change a few things – as wordpress plays tricks with code.
    – must be changed to — (2 minus)
    “ must be “(double quotes)

    Btw, I am binnyva at identi.ca – what about you?

  2. Yeah, I had forgotten that WordPress gets cute with long dashes and directional quotes. I’ll try to add a preformatted tag, to see if that disables the behavior.

    I am “cmdln” on just about every service I use.

    It occurs to me I need to see if I can use krunner under KDE similar to Quicksilver on OS X, to invoke and pass messages to my scripts. Hm…

Leave a Reply

Your email address will not be published. Required fields are marked *