Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Aug 4th, 2005, 11:58 PM   #1
Sane
Programming Guru
 
Sane's Avatar
 
Join Date: Apr 2005
Location: Waterloo, Ontario
Posts: 1,840
Rep Power: 5 Sane will become famous soon enough
Send a message via MSN to Sane
Cool Web Counter

www.1v7.com/drsane/WEB%20COUNTER.zip

Preferred OS: Windows

1) Unzip
2) Open arguments.ini:
-- url: this will be the page to be refreshed
-- counter: once the program is finished, the page will have been accessed >this times the multiplier< many times
-- multiplier: compensates CPU memory for speed, I recommend choosing 10
3) Double click start.pyw
4) At any time if you want to end, double click stop.pyw

It's basically just to raise counter and such. It works very well. For me about 1000 page views a minute, or 17 a second. That's FREAKING fast.

Proof: http://forums.hackthissite.org/index.php?showforum=14

"A Simple Challenge"'s view count is ridiculous. BWAHAHA

Enjoy.
Sane is offline   Reply With Quote
Old Aug 5th, 2005, 8:48 AM   #2
skuinders
Hobbyist Programmer
 
skuinders's Avatar
 
Join Date: Jun 2005
Location: MA, US
Posts: 204
Rep Power: 4 skuinders is on a distinguished road
Be careful doing that to hosts that aren't yours, they might come at you for attempting to DOS their server. (I know you would need several hundred times this amount of traffic to actually do anything, but it still might piss off some people).
__________________
"A stupid man's report of what a clever man says can never be accurate, because he unconciously translates what he hears into something he can understand."
- B. Russell

http://web.bryant.edu/~srk2
skuinders is offline   Reply With Quote
Old Aug 6th, 2005, 8:24 AM   #3
Cerulean
Professional Programmer
 
Cerulean's Avatar
 
Join Date: Apr 2005
Location: London, England
Posts: 459
Rep Power: 4 Cerulean is on a distinguished road
Agreed. Kinda like a naughty bot that doesn't sleep between requests.
Bear in mind you should probably change the User-agent header sent by the urllib request (by setting urllib._urlopener your own FancyURLopener subclass that changes the version member variable) because if you get seen as flooding the server with a user-agent of "Python-urllib" then they'll block all access from that. Quite annoying when others want to write quick little web scrapers and access has to the server has been denied.
Cerulean is offline   Reply With Quote
Old Aug 6th, 2005, 1:43 PM   #4
Sane
Programming Guru
 
Sane's Avatar
 
Join Date: Apr 2005
Location: Waterloo, Ontario
Posts: 1,840
Rep Power: 5 Sane will become famous soon enough
Send a message via MSN to Sane
Yep! That exact thing just happened to my brother. But instead they just blocked our IP address.

Now I'm trying to make it alter the proxy settings so that it shows up as several different IP addresses.

So far I've had no success, because the documentation is scarce and I don't get half the code in the actual urllib2 module.

Help please?

print 'Importing Modules'
import urllib2 ; from random import choice

print 'Uploading Proxies'
exec urllib2.build_opener().open('http://www.1v7.com/drsane/proxies.dat').read()

print 'Initializing Opener\n'
authinfo = urllib2.HTTPBasicAuthHandler()
authinfo.add_password('realm', 'host', 'username', 'password')

for a in range(0):

    proxy = choice(proxies)
    url = 'http://whatismyip.com/'

    print 'Trying %s at %s'%(proxy, url)
    
    CustomProxy = urllib2.CustomProxy(proxy,proxy,proxy)
    proxy_support = urllib2.CustomProxyHandler(CustomProxy)
    opener = urllib2.build_opener(proxy_support)

    opener.open(url)
Sane is offline   Reply With Quote
Old Aug 6th, 2005, 3:04 PM   #5
Cerulean
Professional Programmer
 
Cerulean's Avatar
 
Join Date: Apr 2005
Location: London, England
Posts: 459
Rep Power: 4 Cerulean is on a distinguished road
Well, maybe you shouldn't be trying to mask your actions if the hosts are finding that what you're doing is unreasonable. Maybe you should just be a little more patient, and sleep for a couple of seconds in between each hit of the server.
Cerulean is offline   Reply With Quote
Old Aug 6th, 2005, 3:07 PM   #6
Sane
Programming Guru
 
Sane's Avatar
 
Join Date: Apr 2005
Location: Waterloo, Ontario
Posts: 1,840
Rep Power: 5 Sane will become famous soon enough
Send a message via MSN to Sane
I still want to try to figure this out.

It's for my brother. I won't let him carry it out too far.
Sane is offline   Reply With Quote
Old Aug 6th, 2005, 7:26 PM   #7
Sane
Programming Guru
 
Sane's Avatar
 
Join Date: Apr 2005
Location: Waterloo, Ontario
Posts: 1,840
Rep Power: 5 Sane will become famous soon enough
Send a message via MSN to Sane
Sorry for ze double post. This is a modified version to see if I can get it to switch to a different IP. It tells you what IP and Port it will try to use, and what it ended up using (which is your IP because it doesn't work...).

import urllib2
from random import choice

def stripIP(page):
    x = page.readlines()[3]
    x = x.replace('<TITLE>Your IP  Is ','');x = x.replace(' WhatIsMyIP.com</TITLE>','');x = x.replace('<TITLE>Your IP  - ','');x = x.replace('\n','')
    return x

exec urllib2.build_opener().open('http://www.1v7.com/drsane/proxies.dat').read()    
proxy = list(choice(proxies).items()[0])

print 'Attempting To Access The URL By\n  IP: %s\n  Port: %s\n'%(proxy[0],proxy[1])

proxy_support = urllib2.CustomProxyHandler({'http:':'%s:%s'%(proxy[0],proxy[1])})
http_support = urllib2.HTTPHandler()
opener = urllib2.build_opener(proxy_support, http_support)

opener.addheaders = [('User-agent', 'Mozilla/5.0')]
urllib2.install_opener(opener)

newIP = stripIP( urllib2.urlopen('http://whatismyip.com') )
print str(proxy[0] == newIP) + ', The URL Was Accessed By\n  IP: ' + newIP

I've done all the googling and resourcing I could do, and that's all I can come up with. I hope someone can help.

P.S. This is just so my brother can raise a forum view counter on a topic of his without IP blockage.
Sane is offline   Reply With Quote
Old Aug 7th, 2005, 7:43 AM   #8
Cerulean
Professional Programmer
 
Cerulean's Avatar
 
Join Date: Apr 2005
Location: London, England
Posts: 459
Rep Power: 4 Cerulean is on a distinguished road
Quote:
P.S. This is just so my brother can raise a forum view counter on a topic of his without IP blockage.
That's terribly misleading..
Cerulean is offline   Reply With Quote
Old Aug 8th, 2005, 12:14 AM   #9
Sane
Programming Guru
 
Sane's Avatar
 
Join Date: Apr 2005
Location: Waterloo, Ontario
Posts: 1,840
Rep Power: 5 Sane will become famous soon enough
Send a message via MSN to Sane
Okay it works, and it's worked this whole time too. I just needed a valid proxy from Canada, because the ISP sympatico.ca doesn't go past Canada.

Wow all that extra work for nothing.
Sane is offline   Reply With Quote
Old Aug 8th, 2005, 1:32 PM   #10
Cerulean
Professional Programmer
 
Cerulean's Avatar
 
Join Date: Apr 2005
Location: London, England
Posts: 459
Rep Power: 4 Cerulean is on a distinguished road
Congrats, and nice sample there . Just beware of using exec liberally.
Cerulean is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 3:55 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC