On Mon Jan 16 18:32:13 2012, dan.bolser wrote:
Show quoted text>
> I'm not sure what I'm doing wrong...
>
> When I view my app in twitter, it gives me an access_token and an
> access_token_secret. If I use those in the script, it works (it tweets),
> but users of my script don't have access to that page.
You must have access tokens. The consumer_key/consumer_secret identify
the application. The access_token/access_token_secret identify the
Twitter user. Without both, you can't tweet.
I'm not sure how you're getting the 500 error. If I plug in valid
consumer key and secret, the script displays a URL. If I visit that URL
in the browser, I get the expected authorization page. When I athorize,
I get a PIN number. I enter the PIN number, the script prints out my
access tokens and exits.
If I comment out the exit line, it updates my twitter status:
https://twitter.com/#!/semifor_test/status/159061108899069952
When you distribute the script, you either need to distribute it with
instructions for users to obtain their own consumer key/secret and
access token/secret, or...
...distribute it with your consumer key/secret with a script and
instructions for users to obtain their access tokens. Save the access
tokens so the script can use them on subsequent runs. NOTE: Twitter
frowns on this. They prefer you have user register their own app. If
you choose to distribute your consumer key/secret, you should obfuscate
them so it is not obvious what they are. Twitter has been known to
deauthorize applications that share their consumer credentials.
This isn't a bug in Net::Twitter. Your script, and Net::Twitter work
when the required access tokens are there.