Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

.NET 

Twitter Account & Tweet Scraper

I created this while learning Regex, This will scrape a persons tweets or will scrape twitter accounts from the search.

GIF
Spoiler (Click to View)

Screenshot
Spoiler (Click to View)

Also I couldn't work out how to remove duplicates so I used this snippet here.

Would like feedback on what/if I could of done it better etc

Download:
Source & Binary

VirusTotal:
Here..

Thanks(First post in vb forum)
Had a dream I was king, I woke up, still king
Here's my note: 4/10. (This used to be a 6, when I saw point 4)
And now, here's why:

1. WebRequest in the UI thread. Bad thing is bad. Multi-threading dude !
2. "https://twitter.com/search/realtime?q=" + bb + "&src=typd")" No. When you want to concat strings, you should use "&"
3. This code below V. First, it's alway better to use explicit variable name. Second, why aren't they declared as string ? (You can also reduct this in one line)
Code
Dim lol = Environment.GetFolderPath(Environment.SpecialFolder.Desktop)
Dim la As String = "\twitter.txt"
Dim aaa = lol + la
4. Just saw it when writing this line. Just NO. You don't use threading for webrequest, so what is the point of this ? VERY bad habit, and for nothing.
Code
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
  CheckForIllegalCrossThreadCalls = False
    End Sub
5.
Code
Private Sub SWAG()
... Not a bad point in itself, just ... Explicit name, please, and not that !_!
[6.] Yeah, just one remark, no big deal:
Code
If CheckBox2.Checked = True Then
You can just write "if CheckBox2.Checked Then"

That's all. Be sure to correct these points in the future ;)
Didn't really looking in the RegEx and request in themself, I just saw some loose of time.
This post is not offensive. It's only meant to help.
(Feb 25, 2013 07:55 PM)Yui Asuna Wrote:  Here's my note: 4/10. (This used to be a 6, when I saw point 4)
And now, here's why:

Thanks for the feedback will have a look back on everything
Had a dream I was king, I woke up, still king
(Feb 25, 2013 07:59 PM)Infinit3 Wrote:  Thanks for the feedback will have a look back on everything

No problem dude.
Oh thanks, someone that don't get mad when you correct them :)
Welcome to the .Net section dude !
(Feb 25, 2013 08:00 PM)Yui Asuna Wrote:  No problem dude.
Oh thanks, someone that don't get mad when you correct them :)
Welcome to the .Net section dude !
Why would I be mad ?, I asked for feedback and ways to improve and I got it.

Thanks :)
Had a dream I was king, I woke up, still king
(Feb 25, 2013 08:02 PM)Infinit3 Wrote:  Why would I be mad ?, I asked for feedback and ways to improve and I got it.

Thanks :)

With the Control.CheckForIllegalCrossThreading, you can have no need for that by making simple little delegate subs. Let me throw you an example to give you something to work on:

PHP Code

<?php 
Delegate Sub ChangeLog
()
    Private 
Sub UpdateLog(ByVal text As String, ByVal log As RichTextBox)
  If 
InvokeRequired Then
    Invoke
(New ChangeLog(Sub() UpdateLog(text, log)))
  Else
    
log.AppendText(text)
  
End If
    
End Sub 

Pretty self explanatory, you call with UpdateLog(username, RichTextBox1)

Just an example.
Good luck in future programs though.
[Image: PVoDiqS.png]
(Feb 25, 2013 09:04 PM)Cecilia Wrote:  Just an example.
Good luck in future programs though.

Thanks for the example
I'd like to PM you with some questions.
Had a dream I was king, I woke up, still king
I feel like learning Regex now.. Anyways, thanks for sharing this. 🙂
I recommend uninstalling Windows Eight as fast as you can.
PHP Code

<?php 
CheckForIllegalCrossThreadCalls 
= False 

Never ever do this again OP. This is a very bad habit.
(Feb 25, 2013 10:49 PM)deiski Wrote:  I recommend uninstalling Windows Eight as fast as you can.

I would like too but I can't as this laptop came with it and most of the drivers are win8 only for it.
Had a dream I was king, I woke up, still king
(Feb 25, 2013 11:00 PM)Infinit3 Wrote:  I would like too but I can't as this laptop came with it and most of the drivers are win8 only for it.

I feel sorry for when your computer breaks then, I had it on my 16GB PC, I had to force shut it down by unplugging it, that will then fuck your C:\ drive in the dog, then you have to then download a LIVE-CD OS and mount your Hard Drive, format it from there, and then buy Windows 7.
(Feb 25, 2013 11:04 PM)deiski Wrote:  I feel sorry for when your computer breaks then, I had it on my 16GB PC, I had to force shut it down by unplugging it, that will then fuck your C:\ drive in the dog, then you have to then download a LIVE-CD OS and mount your Hard Drive, format it from there, and then buy Windows 7.

I haven't had much problems with it so far, I also have my whole HDD backuped, It isn't so bad after installing ClassicShell and some other tweaks, My other workstation has windows 7, So I should be alright.


Ok noted don't ever, ever use CheckForIllegalCrossThreads again or the world will end. Any other way other than delegates ?
Had a dream I was king, I woke up, still king


Possibly Related Threads...
Thread / Author Replies Views Last Post
[Python] by littleblueguy24Aug 20, 2023 01:46 AM 8 309 Aug 20, 2023 01:46 AM
Last Post: DashPHP
[C#] by flAmingw0rmDec 31, 2017 06:15 PM 11 703 Dec 31, 2017 06:15 PM
Last Post: Ninja
[Python] by gongas19Nov 15, 2016 06:08 AM 10 2,043 Nov 15, 2016 06:08 AM
Last Post: bytez