![]() |
|
[.NET] Twitch Username Scraper - Printable Version +- Hack Forums (https://hackforums.net) +-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444) +--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151) +---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118) +---- Thread: [.NET] Twitch Username Scraper (/showthread.php?tid=4414680) |
Twitch Username Scraper - iKQLY - Aug 25, 2014 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?tid=3569721&highlight=Twitch+Theme * - +Haze - Aug 25, 2014 What theme is that, looks nice IMHO. * - iKQLY - Aug 25, 2014 (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?tid=3569721&highlight=Twitch+Theme * - Charles Carmichael - Aug 25, 2014 Whats the purpose of scraping mass twitch usernames :o * - DBots - Aug 25, 2014 Okay I'll bite. On your form load event, you have this: ![]() 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. ![]() Rather you check if there may be something stopping you from proceeding first. -- ![]() 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. -- ![]() You call this at the end but there is no need to. * - +Haze - Aug 25, 2014 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. * - iKQLY - Aug 25, 2014 (Aug 25, 2014 06:11 PM)DBots Wrote: Okay I'll bite. 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 |