Hello. I was wondering if someone could take a look at a problem that’s just started occurring for me. I raised a question a couple of years ago on these forums at the below link…

https://twittercommunity.com/t/discussion-about-refusal-of-developer-account-and-api-access/142986/9

…and IgorBrigadir solved the problem I was having. It’s worked perfectly for my needs – until this week.

I’m working on a small project on Twitter in my spare time. I have a master Twitter account that doubles up as a developer account. I have my Consumer Key and Consumer Secret. Using a Ruby environment on https://replit.com/ I have always been able to authorise and retrieve the Access Token and Access Secret of other Twitter accounts so I can run scripts and bots to get the other accounts to behave in various automated ways for a service I’m offering. As I say, it’s worked perfectly for all this time… all stopped this week though…

I’m not sure if this is the same for anyone reading who would care to check this for me… But in the last week, the Ruby environment at https://replit.com/ has stopped working for me. It now doesn’t do what I’m used to it doing for me and I’ve been using it for about 18 months now after following IgorBrigadir’s instructions on the other thread.

I don’t know how to troubleshoot this, as literally the only coding I can do in Ruby is below.

(I should mention that normally when I log into the Ruby terminal, there was pre-populated text at the top of the console. It now doesn’t appear. Is this what is causing my problems??)

My method is as follows in the Ruby environment. I need to be logged into the Twitter account that I want to automate, not the Developer account. I key the following:

gem install --user twurl

image

This will output some code saying that 2 gems are installed.

image

Next I key the following:

../.gem/ruby/2.5.0/bin/twurl authorize --consumer-key [consumer key here] --consumer-secret [consumer secret here]

This then usually gives me a clickable link which opens a browser tab displaying an auth code, I copy and paste the auth code into the Ruby terminal and a message is displayed showing the code is accepted.

I then key the following

cat ../.twurlrc

…and displayed will be the Access Token and Access Secret of the account. This has worked for me for the best part of 18 months whenever I’ve needed to authorise my App to control a new Twitter account.

The only thing is, in the last few days on https://replit.com/ after I key in this…

../.gem/ruby/2.5.0/bin/twurl authorize --consumer-key [consumer key here] --consumer-secret [consumer secret here]

The result I get is this…

bash: ../.gem/ruby/2.5.0/bin/twurl: No such file or directory

image

Before logging into these forums I have tried Googling this error, I don’t understand the results I found. I have actually installed (and now uninstalled) the Ruby program from Googling it, ran the .exe and opened it, tried to run the exact same scripts as I’ve detailed above in the terminal window but it didn’t work because I don’t know what I’m doing…

All I know is how to use replit.com and it takes me about two minutes to get the Access Token and Access Secret for other Twitter accounts because I’ve done it before so many, many times. And now it’s broken…

So I’m here asking for help. Is there any other way I can get the Access Token and Access Secret of my other accounts?

Bearing in mind I don’t have the first clue about the OAuth documentation or how to use it. I am very much at a beginner level but the instructions IgorBrigadir gave me in the other thread about using the Replit website was exactly what I needed for my project and it was all I needed to know for my needs, but if that’s off the table now, I am willing to follow any instructions anyone may have for me, reinstall the Ruby software and try to succeed where I failed last week. I don’t understand why it has always worked for me using a Ruby emulator but not the “real” Ruby .exe program I downloaded.

I hope I have made clear what my issue is, please ask for further instructions from me if I haven’t been clear enough. Looking forward to trying to fix my issue with your expertise and help.

Thank you.

Edit: I should also say, I have tried this in Chrome, Firefox and Edge. It still doesn’t work. I haven’t tried a different computer or laptop as I don’t have access to one.

It looks like you’re in the “Console” when you should be in “Shell” for this to work. Also replit seem to have changed a bunch of things last time i tried this - I also got some warnings about Nix, but in the end it worked:

In the Shell tab of a new Ruby repl:

gem install twurl

Then

twurl authorize --consumer-key aaaaaaabc --consumer-secret dddddddddef

You’ll get a warning:

twurl: command not installed, but was located via Nix.
Would you like to run twurl from Nix? [Yn]: y

type Y and continue as normal.

Now it will print out a bunch of extra warnings about Nix but in the end you’ll have the usual twurl output, once you visit the url, enter the pin, etc

cat ../.twurlrc

to read the generated token

2 Likes

@IgorBrigadir

deniro

Thank you very, very much my friend. That’s all worked. :smile:

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.