kirgroup.com
Fabio 2 years ago Friendica

Bash, OAuth and json...

This is mainly for @tony baldwin :-)

A very simple ~friendica ~friendica client, wich uses #OAuth to authenticate with the server and #JSON to get user timeline. All written in #bash. It requires only openssl and perl.

Is based on bash-oauth and JSON.sh

Find the tar.gz attached.

To install extract all files somewere in your $PATH, then create the configuration file in your $HOME:

~/.fcli.rcfriendica_url=http://kirgroup.com #no trailing slash
oauth_consumer_key='1234567890'
oauth_consumer_secret='1234567890'


Make up two values for "consumer_key" and "consumer_secret" (I used "1234567890" for both).
Go to your friendica, "Settings"->"Connected apps" -> "Add application".
Fill in your consumer key and secret, leave blank "Redirect" field, put a meaningful name, and an url to a icon you like (I used this : Image/photo )

Run $ flci.sh and follow instruction to authorize the application.

If everting goes well, you can see last 5 items in network page with
$ fcli.sh -c home_timeline
and you can update your status with
$ fcli.sh -c statuses_update -s "type message here"
10.5% english
Mr. X 2 years ago Friendica
Feel free to stick stuff like this and friendi.sh in the repository (perhaps in /util or /mods) because often the links to all these tools seem to get lost in documentation pages or our network stream.
1.7% english
Arto 2 years ago Friendica
Hmm, can't seem to get the PIN. I go to the url to get the pin (http://myfriendica.net/api/oauth/authorize?oauth_token= ) and get: "Invalid request. Unknown token."

I'm using the same Oauth strings as listed in the example above.
7.6% english
Arto 2 years ago Friendica
Just pulled, but still no luck. Don't know, I'll muck around with it a bit later again.
12.9% english
Arto 2 years ago Friendica
Yes to both. Still getting that error. Can't figure out what's wrong, but it's not that important at this moment.
18.3% english
Fabio 2 years ago Friendica
@Arto, there should be a string after "oauth_token=" in that url. Someting is missing. Have you added the app under settings/oauth? Have you created ~/.fcli.rc with same values for key and secret as in settings/oauth ?
@arto
13.7% english
Arto 2 years ago Friendica
Yes, it is working flawlessly! I had a brain shutdown :)
11.8% english
Report Bug