Hi all. I must confess that I would not even know where to begin on this, so any tips are welcome.
The idea is simple. I want to go down my list of followers on twitter, then copy each of their @Names to text file, one per line.
I attempted to do this in other languages and found it impossible.
Any ideas?
Thank you all for your time.
Scrape my followers list... Topic is solved
Re: Scrape my followers list...
I do have an idea as to how this could be accomplished logically, but still not sure how I could implement it in AHK.
Use browser find to highlight something starting with @.
Detect and highlight all characters in the word.
Copy to clipboard.
Output to text.
Thats the idea written in logic form.
Thoughts?
Use browser find to highlight something starting with @.
Detect and highlight all characters in the word.
Copy to clipboard.
Output to text.
Thats the idea written in logic form.
Thoughts?
Re: Scrape my followers list...
Twitter lets you download a list of your followers, why build a scraper?
Re: Scrape my followers list...
Because I only want a list of the @names. Nothing more. Right now, that means a LOT of copy/paste activity.trey ton wrote:Twitter lets you download a list of your followers, why build a scraper?
Re: Scrape my followers list...
I have spent a number of hours learning as much as I can about AHK. I must admit, this is unlike any language I have ever used before.
I am beginning to wonder if what I want to do is even possible in this language. I know that I could do this if I knew anything about writing browser addons, but sadly I am not even close to being able to do that.
I want to make this clear... I hate the idea of asking people to do something for me. The only reason that I formatted the post this way is because I am still very new to this language. With a few months of practice I should have a decent grasp on it, but I was just hoping someone might have an idea for now.
I am beginning to wonder if what I want to do is even possible in this language. I know that I could do this if I knew anything about writing browser addons, but sadly I am not even close to being able to do that.
I want to make this clear... I hate the idea of asking people to do something for me. The only reason that I formatted the post this way is because I am still very new to this language. With a few months of practice I should have a decent grasp on it, but I was just hoping someone might have an idea for now.
Re: Scrape my followers list...
Many plugings will get you your followers, ahk can do it too but just use what works alreadyDraygoes wrote:I have spent a number of hours learning as much as I can about AHK. I must admit, this is unlike any language I have ever used before.
I am beginning to wonder if what I want to do is even possible in this language. I know that I could do this if I knew anything about writing browser addons, but sadly I am not even close to being able to do that.
I want to make this clear... I hate the idea of asking people to do something for me. The only reason that I formatted the post this way is because I am still very new to this language. With a few months of practice I should have a decent grasp on it, but I was just hoping someone might have an idea for now.
- FanaticGuru
- Posts: 1908
- Joined: 30 Sep 2013, 22:25
Re: Scrape my followers list...
If you can download the followers to a text file by any means, it will then be much easier to get AHK to pull out of that text file a list of just the followers' names. Less than a dozen lines of code.Draygoes wrote:Because I only want a list of the @names. Nothing more. Right now, that means a LOT of copy/paste activity.trey ton wrote:Twitter lets you download a list of your followers, why build a scraper?
Not as good but if you just get all the data on to the clipboard then it is pretty trivial to get every word starting with @ out of the clipboard.
This code will list every word starting with @ that is currently on the clipboard.
Code: Select all
X:=1
while (X := RegExMatch(Clipboard, "(@\w*)", M, X+StrLen(M)))
MsgBox % M1
With a couple more lines the script instead of listing them one at a time could create a list and save as a text file.
FG
Hotkey Help - Help Dialog for Currently Running AHK Scripts
AHK Startup - Consolidate Multiply AHK Scripts with one Tray Icon
Hotstring Manager - Create and Manage Hotstrings
[Class] WinHook - Create Window Shell Hooks and Window Event Hooks
AHK Startup - Consolidate Multiply AHK Scripts with one Tray Icon
Hotstring Manager - Create and Manage Hotstrings
[Class] WinHook - Create Window Shell Hooks and Window Event Hooks
-
- Posts: 60
- Joined: 13 Apr 2016, 22:02
Re: Scrape my followers list... Topic is solved
just curious ...if this works.
Code: Select all
X:=1
while (X := RegExMatch(Clipboard, "(@\w*)", M, X+StrLen(M)))
{
; MsgBox % M1
FileAppend, %M1%`n, Test.txt
}
Re: Scrape my followers list...
I just tried it. It placed a single @ char in the text file.neverlevel wrote:just curious ...if this works.Code: Select all
X:=1 while (X := RegExMatch(Clipboard, "(@\w*)", M, X+StrLen(M))) { ; MsgBox % M1 FileAppend, %M1%`n, Test.txt }
Re: Scrape my followers list...
But the code with the message box worked perfectly!
Re: Scrape my followers list...
Ok, I had made a mistake with the append code. I forgot to copy the list. It works great!
Is there any way to have each name in a new line?
Thanks all! I mean that!
Is there any way to have each name in a new line?
Thanks all! I mean that!
-
- Posts: 60
- Joined: 13 Apr 2016, 22:02
Re: Scrape my followers list...
should already be that way...
my test has 3 lines.. the 'n does new line
try taking the text file....copying it to clipboard....deleting the current messed up version and running the code again? i dont know what format your clipboard has that may be messing it up
my test has 3 lines.. the 'n does new line
try taking the text file....copying it to clipboard....deleting the current messed up version and running the code again? i dont know what format your clipboard has that may be messing it up
Re: Scrape my followers list...
So this is strange.
I uncommented the msgbox and it works perfectly. Each to a new line. I remove the message box completely, and it works great. It screwed up with the commented message box in there. I can even repeat by putting the commented out message box back.
Just find that strange.
That works perfectly man. Thank you very much. You guys have saved me a LOT of time.
I uncommented the msgbox and it works perfectly. Each to a new line. I remove the message box completely, and it works great. It screwed up with the commented message box in there. I can even repeat by putting the commented out message box back.
Just find that strange.
That works perfectly man. Thank you very much. You guys have saved me a LOT of time.
-
- Posts: 60
- Joined: 13 Apr 2016, 22:02
Re: Scrape my followers list...
np. good luck with your future projects
-
- Posts: 1
- Joined: 07 Aug 2023, 12:40
Who is online
Users browsing this forum: AlFlo, VaritySpice and 117 guests