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

.NET 

Twitch Username Scraper

Saw this being sold in the Premium Sellers Section. I really don't believe people should have to pay for something that takes only an hour or two, so I'll release my twitch scraper.
It is multi-threaded so it shouldn't lag when scraping

All you need to do is enter in a channel name. The listbox will then populate all viewers watching. You can then export to a text file.

If anyone wants to comment on the code and possible suggest any way it could be optimized, feel free to post here.

Source Code:Spoiler (Click to View)

Application Only:Spoiler (Click to View)

Image: Spoiler (Click to View)

Credit to Tidas for theme: https://hackforums.net/showthread.php?ti...itch+Theme
poop
What theme is that, looks nice IMHO.
(Aug 25, 2014 03:08 PM)+Haze Wrote:  What theme is that, looks nice IMHO.

Thanks :) It's Twitch Theme, I think Tidas released this.

Here's link for theme
https://hackforums.net/showthread.php?ti...itch+Theme
poop
Whats the purpose of scraping mass twitch usernames :o
[Image: I4qSLZW.gif]
Okay I'll bite.

On your form load event, you have this:
[Image: iC2AHcJ.png]

Don't do that. That is not proper threading which is what I suppose you were trying to accomplish here. Once you remove that, you'll be on your way to properly threading this since you won't be suppressing any errors and you can more easily debug your application.

--

You instantiate a WebClient but then it is possible you may not use it and didn't even dispose of it.

[Image: 9QZQLLs.png]

Rather you check if there may be something stopping you from proceeding first.
--

[Image: EemnQ6B.png]

Here, you acknowledge there may be an error and when there is, you still try to process the result, which there isn't one.
I would rather take the approach of making sure the string was downloaded before moving on to trying to process it.

--

[Image: WkszwcF.png]
You call this at the end but there is no need to.
I agree with what dbots said. I see you're trying to use Multi threading. In that case use Webclient download string async method. It's so much better and faster when dealing with large amounts of data or doing things quickly.
(Aug 25, 2014 06:11 PM)DBots Wrote:  Okay I'll bite.

On your form load event, you have this:
[Image: iC2AHcJ.png]

Don't do that. That is not proper threading which is what I suppose you were trying to accomplish here. Once you remove that, you'll be on your way to properly threading this since you won't be suppressing any errors and you can more easily debug your application.

--

You instantiate a WebClient but then it is possible you may not use it and didn't even dispose of it.

[Image: 9QZQLLs.png]

Rather you check if there may be something stopping you from proceeding first.
--

[Image: EemnQ6B.png]

Here, you acknowledge there may be an error and when there is, you still try to process the result, which there isn't one.
I would rather take the approach of making sure the string was downloaded before moving on to trying to process it.

--

[Image: WkszwcF.png]
You call this at the end but there is no need to.

Awesome, thanks! Just added in what you pointed out


(Aug 25, 2014 07:27 PM)+Haze Wrote:  I agree with what dbots said. I see you're trying to use Multi threading. In that case use Webclient download string async method. It's so much better and faster when dealing with large amounts of data or doing things quickly.

Thanks, never really bothered to look at async method. Just added it as well
poop


Possibly Related Threads...
Thread / Author Replies Views Last Post
[Python] by ThreebonesMar 9, 2017 07:04 PM 16 1,537 Mar 9, 2017 07:04 PM
Last Post: Invictum
[C#] by i-manuelAug 18, 2016 06:10 PM 5 342 Aug 18, 2016 06:10 PM
Last Post: Ninja
[.NET] by CC_AnoNApr 14, 2015 09:34 AM 10 570 Apr 14, 2015 09:34 AM
Last Post: Ninja