Can someone create an application that can allow me to see everyone on my blocked list and also remove everyone on my blocked list? My twitter account was hacked and has over 21,000 people on my blocked list. So I can't view them all or unblock them all (practically).

So if I understand your theory correctly the API would make 5 request automatically to "blocks/ids.json". I assume this is because "The number of IDs returned is not guaranteed to be 5000" atleast according to https://dev.twitter.com/rest/reference/get/blocks/ids. So the api getting all the names all at once would be "impossible" from the API's end due to twitter limiting it? Then after this is done the API will have a bunch of user ID's (not names) which could then be stored in a list to appear as names. Then lastly the API would just mimic unblocking all the users as if I were to do it manually myself using the command "blocks/destroy.json".

Did I get that about right?

If so what would be the difference between me attempting to manually do this myself and the API performing this action? I assume it would be speed as the API would probably be able to do it at a faster rate than me attempting to click on 21,000 usernames. I just need some clarification on this. Also thank you for your response and atleast attempting to tackle this manner. You have done more than most have and I appreciate that a lot.

The API would be able to do this as fast as Twitter's rate limit on that endpoint will allow. And while speed is an important consideration, I'd say not having to click 21,000 usernames is probably the biggest win.

Yes! This absolutely helps a lot. How can this API be implemented? I need it as soon as possible. I would like to be able to save a list of all the names from my blocked list and of course unblock them. However the list part is important as well because I would like to get back in touch with some of them. In any event, how can this get implemented?

I guess C/C++ isn't considered much programming. However I did start this thread off by asking if someone would be willing to create this API. While I could possibly be of assistance in the production of it, I wouldn't know where to even start to get this kind of thing implemented. If I did know then I would've just done it all by myself. However this is why I am here asking for help. Since a lot of people are experts at developing API's here then i'm pretty sure what I am asking for is a simple task. It seems like it would be about 10 - 15 lines of code at the most. I appreciate @jcbl for even being able to give somewhat of an idea as to how the program could work and even going as far as to include some "pseudocode".

With that being said since there are already so many experts here without me having to travel to an external website (IE; freelance.com, craigslist, backpage, ect.) anyone that's willing to volunteer to help create this project is HIGHLY appreciated. While I can't speak for everyone I know that this personally would help me out tremendously. So if it helps me out i'm pretty sure it would help a lot of other people out as well.

I'm sorry if I offended you, I was basing that part of my response off of:

AcUploads:

How can this API be implemented?

I was just trying to advise you based on the last few posts and it seeming like you were looking to have someone make it for you. You may be able to find someone on these forums to build it for you but I was just offering an alternative if you needed something a little faster.

You are right in assuming it's a small task but 10-15 lines may be underestimating since you have to account for rate limits, caching the list, etc..

Since we all either do this for a living or (at least in my case) want to, it's usually considered bad form to ask for free work. Also, those 10-15 lines generally mean that we've had to spend a lot of time learning the ins and outs of twitter and our language of choice. That said, this should work for you.

Since we all either do this for a living or (at least in my case) want to, it's usually considered bad form to ask for free work. Also, those 10-15 lines generally mean that we've had to spend a lot of time learning the ins and outs of twitter and our language of choice. That said, this should work for you.

Words can't express enough how thankful I am for you taking the time out to help me. This is like late Christmas gift for me. I really appreciate it!

jcbl:

tweet_mode='extended' sleep_on_rate_limit=True)

The code you wrote was almost perfect except one thing. There was a syntax error on line 20 . However I was able to figure out that it was just a comma missing on line 19 .

jcbl:

import twitter

When I tried to run the program after adding fixing the syntax error it said I was missing the twitter module. Where would I find that at?

So I have good news and I have bad news. The good news is I was able to install the twitter module via pip just like you said and I don't getting the twitter module is missing error anymore. The bad news is now I am getting these are the errors:

I was finally able to create the application. I had trouble because for some reason twitter disabled my account from being able to add a phone number. However after I got that fixed I created the app. I ran the python code with the "appropriate" keys (I believe anyway) and it gave me back these errors:

Okay I got it to work. The problem was the tokens. I was under the assumption that the "Consumer Key (API Key)" went into all the key categories. Then I realize there was a "manage keys and access tokens" link next to it.

I clicked on the link and found the "Consumer Secret (API Secret)" key. However it still didn't work and I was wondering why. Then I realized the "Your Access Token" dialogue below it indicating that I didn't give my own account an access token.

So that's where the confusion came in. I didn't give my access tokens to my account under the belief that the "Consumer Key (API Key)" were those tokens. It's also something I didn't notice before. Looking back now it seems so simple like "Hey why didn't you just scroll down the page?" but I swear I never noticed that part there. It's as if it just appeared, however i'm sure it was always there. Good thing it was pointed out that the tokens were the problem or else I would've thought all those other lines of errors needed to be corrected too.

With that being said even though I got the program to run without errors, nothing actually happens. So where do I go from here? @jcbl

To be fair, I don't think @jcbl intended for this thread to become an interactive debugging session for some free code he quickly created to handle the use case you were requesting help with, and would imagine he'd prefer you to start to learn from what he provided

So you're saying no files are being created by the code? No .txt or .json files are appearing in the folder where you're running the script?

To be fair, I don't think @jcbl intended for this thread to become an interactive debugging session for some free code he quickly created to handle the use case you were requesting help with, and would imagine he'd prefer you to start to learn from what he provided

To be fair, neither did I. However, I was willing to put in the effort to do what I needed to do to get a solution to my problem. As much of a headache as it may have been to debug this code, imagine attempting to learn through trial and error. I think most people who aren't familiar with coding would have trouble. With that being said I am learning but it's still a process. No one said anything worth working for would be easy, but I think it's safe to say that we are making progress.

andypiper:

So you're saying no files are being created by the code? No .txt or .json files are appearing in the folder where you're running the script?

That's what I thought at first until you mentioned it. Then I actually just checked the folder where I ran the script. The program actually does work!

I didn't know this though because after I ran the script the screen just went blank, and I was waiting for something amazing to happen. Unfortunately there was no indication that anything was happening. However after reading your comment and checking the folder I found 2 files. One that list the usernames, and another that shows which usernames have been unfollowed. So the program technically speaking is a success!

However there is one slight issue. The usernames come up as Numbers or "ID's". Is there a way to convert them to so that it shows the actual usernames? @jcbl