Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import re, urllib, threading
- # +=========================================================+
- # | Check status KIA, last time of user in vOz |
- # | Author: Huy HΓΉng - KMA |
- # | Create time: 20:29 - 09/02/2015 |
- # +=========================================================+
- try:
- import urllib.request
- except:
- pass
- def Check_Status(user_id, pattern, *args, **kwargs):
- try:
- u = urllib.urlopen('http://vozforums.com/member.php?u='+user_id)
- except:
- u = urllib.request.urlopen('http://vozforums.com/member.php?u='+user_id)
- text = u.read()
- pattern_name = re.compile(r'Profile+(.*)</title>+', re.I|re.M)
- name = re.findall(pattern2, str(text))
- status = re.findall(pattern, str(text))
- pattern_last = re.compile(r'Activity:</span>+(.*)<span class="time">+')
- last = re.findall(pattern_last, str(text))
- result = "ID: "+user_id+" Name"+name[0]+" Status: "+ status[0]+" Last Activity:"+last[0]+"\n"
- print result
- def GetNameFromURL(website, pattern, *args, **kwargs):
- try:
- u = urllib.urlopen('http://vozforums.com/forumdisplay.php?f=17&pp=20&sort=dateline&order=desc&daysprune=-1&page='+website)
- except:
- u = urllib.request.urlopen('http://vozforums.com/forumdisplay.php?f=17&pp=20&sort=dateline&order=desc&daysprune=-1&page='+website)
- text = u.read()
- user_ids = re.findall(pattern, str(text))
- pattern_status = re.compile(r'<h2>+(.*)</h2>+', re.I|re.M)
- for i in user_ids:
- t = threading.Thread(target=Check_Status,
- args=(i, pattern_status))
- t.start()
- threadList.append(t)
- if __name__ == '__main__':
- ## -- EASY --
- pattern = re.compile(r'member\.php\?u=(\d*)\'{1}', re.I|re.M)
- threadList = []
- for s in range(8330,8338):
- print 'Searching: ' + str(s)
- t = threading.Thread(target=GetNameFromURL,
- args=(str(s), pattern))
- t.start()
- threadList.append(t)
- print ('\nMAIN PROGRAM COMPLETE\n')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement