Hello,
I would like to ask a question so that I do not violate any rules or terms. I am pretty new to Twitter and APIs and it’s possible that I do something wrong.
This is my personal account, litterpicker (1). I also have another twitter account (at)democracyportal (2) with a website democracyportal(dot)org (3).
I have applied and gotten a developer account granted (1) and created an API. My question:
Can I with the API from this Twitter account (1) publish posts automatically from the website (3) to the Twitter account (2) or should I apply for a new developer account for the other Twitter account (2) and create an API?
I would use a Wordpress plugin for sending the posts to Twitter.
I have also heard about Oauth 1.0 and 3 legged Oauth, but I am a novice and it is hard to implement those steps.
Thank you
David
1 Like
Sure thing - you only need your 1 developer account - litterpicker - take the consumer key and secret from your app details under Keys & tokens, and use those with something like GitHub - twitter/twurl: OAuth-enabled curl for the Twitter API to run
twurl authorize --consumer-key AAabBB --consumer-secret CCcDD
Log in as the democracyportal account, enter the pin, and look for a .twurlrc file in your home directory - that will have the access token and secret you need.
In wordpress it depends on what plugin you’re using but you’ll always need to provide Consumer key and secret and an access token and secret somewhere.
1 Like
Thanks! This is a great start. Saw it before but did not understand it, thanks for pointing me in the right direction.
Im just not sure where the code that you refer to should be put and to what the downloaded Twurl-master file is used. Will have to look through some tutorials. If you would like to advice me further, feel free to do so. 
The Wordpress plugin Social media auto publish works when auto publishing on litterpicker, so the keys and tokens must have been added successfully. I was happy about that, but my problem was that I wanted the auto publish to occur on the (at)democracyportal.
David
Hello again,
I got the PIN authorized in the terminal, but I was logged in at Twitter with litterpicker, does it matter?
What would the next step be? The posts still occur in the wrong Twitter account.
I´m not sure I understood the .twurlrc part.
Thanks again
David
I got the PIN authorized in the terminal, but I was logged in at Twitter with litterpicker, does it matter?
Yes, that matters - that would generate an access token for litterpicker so if you use that access token, litterpicker will tweet. twurl will keep several keys for different accounts in the .twurlrc file so you can repeat the process while logged in as democracyportal to get keys for that account
.twurlrc file is generated by twurl and is usually in your home directory somewhere - it may be hidden by default. It’s a text file and looks like this (my keys redacted):
---
profiles:
IgorBrigadir:
AAAAAAA:
username: IgorBrigadir
consumer_key: AAAAAAA
consumer_secret: bbbbbbbbbbbbbbbb
token: 111111111111-ccccccccc
secret: dddddddddd
configuration:
default_profile:
- IgorBrigadir
- AAAAAAA
You want to extract AAAAAAA, bbbbbbbbbbbbbbbb, 111111111111-ccccccccc, dddddddddd parts out of that text file and paste them into whatever wordpress plugin you have
1 Like
Thank you. One very simple question, I must add a new App for democracyportal (in the dev section for iiterpicker) with keys and tokens for terminal authorization, right?
It’s generally one app per use-case - so if you already have an app for “Post tweets from a blog to twitter” just keep using that one. In other words - the same Consumer key and secret can be used to authenticate multiple twitter accounts.
The app owner doesn’t matter, app name comes up in tweets as the source, and you can change this if you need - but it has to be unique.
You can create a new app too if you like to organize it a different way, you have a limit of 10 apps in your developer account if i remember correctly. Hope that helps!
1 Like
Now I should be able to figure this out. Thanks! Good to know that one App could be used to post on another Twitter account. That got me think at first. I´m not a programmer but I think I start to see how an app is used for a certain function, instead of attributing an app to a certain account. We newbies are here too.
Just got to find the twurlrc …
Have a great day, or Midsummer!
/iitterpicker
1 Like
Hello,
I´m not really getting it to work. Twurl accounts writes out three usernames and the API keys, but rc file is empty of any references to usernames, keys and tokens. Why do you think that is?
Also, is it important how I use the section in the image? It´s from the app.

Will be happy for any input from your side.
Thanks
No, it’s best to not fill that callback url and disable the “Enable Sign in” checkbox unless you are actually using it with the web signin flow Log in with Twitter | Docs | Twitter Developer Platform - which i doubt - but i could be wrong.
twurl output in the terminal will be empty - but there should be a file called .twurlrc written somewhere - this depends on your OS - is it windows? if you run twurl accounts in terminal you should see some output of your consumer key if the twurl authorize command worked - so it should be a matter of finding that .twurlrc text file that will be structured like my example - you’ll find your keys there.
1 Like
No, that’s the code in twurl itself - the .twurlrc file (empty name, only extension) is created after you run it in a command prompt after it’s installed. For Windows 10, make sure you have “Show hidden files” on and maybe this will help? Twurl on Windows after it’s run with the pin and everything, try the windows file finder to search for .twurlrc file
1 Like
Now it works! With a few clicks, wow. Thank you for continuing to write back. Couldn´t have done this without your help. Now I know more and will to a greater extent be able to use the services of Twitter. I had the files hidden and now showed them, but I think I searched in the wrong place at first really. Thank you again /David
1 Like
system
Closed
#15
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.