Site Map - skip to main content - dyslexic font - mobile - text - print

Hacker Public Radio

Your ideas, projects, opinions - podcasted.

New episodes Monday through Friday.

Please support our Patrons

Our hosting is kindly provided by Josh from We would appreciate it if you could donate to help reduce his costs in funding the hosting. He is also accepting bitcoins to 1KsxJr9HtsdaUeU7yaV9bk9bQi21UPBtUq
Please also consider supporting the who are now hosting our media files. Right now, a generous supporter will match your contributions 3-to-1. So your $5 donation results in $20 for the Internet Archive.

hpr1799 :: Posting From the Command Line on Open Social Networks

I explain how to post content from the command line on open social networks and GNU Social

<< First, < Previous, Latest >>

Host Image
Hosted by Jon Kulp on 2015-06-25 is flagged as Clean and is released under a CC-BY-SA license.
Tags: scripting, command-line, social media, GNU Social,
Listen in ogg, spx, or mp3 format. | Comments (0)

Posting From the Command Line on Open Social Networks

You can post to your open social media timelines from the command line using API access. Why would you want to do this?

  • Script automated postings.
  • Bots
  • Post from terminal environments.
  • Post from wherever else you are without having to go to the social media site or to the client that you use to access it.
  • Trigger postings via voice command (what I do).

On GNU Social

Here is the basic format for the command to post a message to a Statusnet / GNU Social timeline:

curl -s --basic --user <username:password> --data status="Hello World" --output /dev/null

And here is the script I use to post a message to my timeline, launched by a blather voice command:


# SN account info

# a place to store the text message 

# Virtual keystrokes to copy selected text to the clipboard
xdotool key Control+c

# pipe text out of clipboard into the text file
xclip -o > $text

# rest for half a sec
sleep .5

curl -s --basic \
--user $user:$pass \
--data status="$(cat "$text")" \
--output /dev/null \ 

rm $text

exit 0


On you have to install the software on your computer. You don't have to be running a server, you just have to have the binaries so that you can run the commands. I will not go into how this is done on this podcast, but there's a link to the website below and there should be installation instructions available there. Once you have the software installed, you also have to allow command-line access to your account and get the token for authentication, maybe authorize the user too:

pump-register-app -s -P 443 -t CLI
pump-authorize -s -P 443 -u username

Finally you can post to your timeline from the command line:

pump-post-note -s -P 443 -p -u username -n "Hello World."

My script to post a message to the timeline, launched by a blather voice command:


# a place to put the text. 

# --------------------------------
# Since markdown is possible, I run 
# the text through markdown to get
# a bit of formatting and save it
# as a separate file 
# --------------------------------

# Virtual keystrokes to copy selected text to the clipboard
xdotool key Control+c

# pipe text out of clipboard into the text file
xclip -o > $text

# run Markdown
markdown $text > $pump

# Post message
pump-post-note -s -P 443 -p -u username -n "$(cat $pump)"

sleep 1

rm $text
rm $pump

exit 0



Subscribe to the comments RSS feed.

<< First, < Previous, Latest >>

Leave Comment

Note to Verbose Commenters
If you can't fit everything you want to say in the comment below then you really should record a response show instead.

Note to Spammers
All comments are moderated. All links are checked by humans. We strip out all html. Feel free to record a show about yourself, or your industry, or any other topic we may find interesting. We also check shows for spam :).

Provide feedback
Your Name/Handle:
Anti Spam Question: What does the P in HPR stand for ?
Are you a spammer →
Who hosted this show →
What does HPR mean to you ?