Skip to content

Instantly share code, notes, and snippets.

@scarpentier
Last active December 25, 2015 20:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save scarpentier/711186144b655672cc97 to your computer and use it in GitHub Desktop.
Save scarpentier/711186144b655672cc97 to your computer and use it in GitHub Desktop.
import urllib2
from random import randint
from time import sleep
proxyfile = 'proxy.txt'
url1 = 'http://socialize.us1.gigya.com/socialize.incrementReactionsCount?format=jsonp&sdk=js_2.21.7&APIKey=2_1ZHSfzlERzsDih4WQUsH3FV7ixrjeBFgQneQK0He-7w7XNIMcTJEM0i8Id6tXbCy&source=showReactionsBarUI&sourceData=%7B%22barID%22%3A%22geekOct17%22%2C%22buttonID%22%3A%22Simon%22%2C%22buttonText%22%3Aundefined%7D&barID=geekOct17&buttonID=Simon&count=1&callback=gigya.global.JPCMD.prototype.handleResponse&context=888943447'
url2 = 'http://backend.musiqueplus.com/incVideoCount_Polopoly.jsp?callback=jQuery171016662127245217562_1382063794585&videoId=1.1245456&title=Geek+Recherch%C3%A9+-+Simon+Carpentier&artist=&isrc=&upc=&label=&_=1382063817115'
referer = 'http://www.musiqueplus.com/videos/geek-recherche-simon-carpentier-1.1245456'
def voteGigya():
try:
print 'Vote Gigya :',
req = urllib2.Request(url1)
req.add_header('Referer', referer)
response1 = urllib2.urlopen(req).read()
print 'OK'
except Exception:
print 'FAIL'
def voteMP():
try:
print 'Vote MP :',
req = urllib2.Request(url2)
req.add_header('Referer', referer)
response2 = urllib2.urlopen(req).read()
print 'OK'
except Exception:
print 'FAIL'
def proxyVote():
with open(proxyfile) as file:
for line in file:
line = line.rstrip()
proxy = urllib2.ProxyHandler({'http': line})
opener = urllib2.build_opener(proxy)
urllib2.install_opener(opener)
print 'Current IP : %s ...' % line
vote()
def vote():
voteGigya()
voteMP()
sleepyTime = randint(10,30)
print 'Sleeping %s seconds' % sleepyTime
sleep(sleepyTime)
print '------------'
while(True):
proxyVote()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment