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

Python 

Invision Power Board View Bot

So I wanted to increase the view count on one of my posts in a forum run by some people I knew. Rather than do it manually, I decided to write a bot in Python. It was written for IPB4, but I am not sure if it is backwards compatible or not depending on whether the HTML code matches up. Anyways here it is...

https :// ghostbin . com /paste/bsjos (remove spaces, I don't have enough post count)

I want to ask the community this:
  • How can I make this a multi-threaded script so it can send more responses at one time
  • Any further optimizations to the code, and if so, please post your new and improved source code

There are several requirements for the script to run. You need to have the following:
  • Selenium module installed ($ sudo easy_install Selenium)
  • BeautifulSoup module installed ($ sudo easy_install BeautifulSoup4)
  • Python 2.7
  • Firefox browser

Here are the following lines you need to edit to make the script work for you:

PHP Code

<?php 
url 
= "https  :// crackyoass . com/index . php?/topic/146-list-of-scripts/" 

Change that to whatever post on the forum you want to boost

PHP Code

<?php 
browser
.get("https ://  crackyoass . com/index . php?/login/") 

Change that to the login pages

The usage is as follows: python ViewBot.py username password
For the lazy people: https://ghostbin.com/paste/bsjos
(Mar 9, 2017 04:28 PM)caiveman Wrote:  Ur not a legitimate user
Ur a paki skid

Thank you 🙂

Also, do you know how to make the script multithreaded? Haven't tried my hand at that yet and Im not really sure how to implement it
(Nov 11, 2015 05:45 PM)Baba Yaga Wrote:  I want to ask the community this:
  • How can I make this a multi-threaded script so it can send more responses at one time
  • Any further optimizations to the code, and if so, please post your new and improved source code

Haven't taken a good look at it yet but off the bat I know you could use asyncio and aiohttp to do just that.

Here is some garbage code I never got around to finishing that uses it:
PHP Code

<?php 
import lxml
.html
import asyncio
import aiohttp


@asyncio.coroutine
def get
(*args, **kwargs):
    
response = yield from aiohttp.request('GET', *args, **kwargs)
    return (yield from 
response.read_and_close())

def first_link(page):
    
fragment = lxml.html.fromstring(page)
    
path = fragment.xpath('//div[@class="data"]')
    return 
path

@asyncio.coroutine
def print_link
(query):
    
with (yield from sem):
        
page = yield from get(query, compress=True)
    
link = first_link(page)
    print(
'Coub: {} // Track: {}'.format(query, link))

links = ['http://coub.com/view/8jcbd']
sem = asyncio.Semaphore(5)
loop = asyncio.get_event_loop()
f = asyncio.wait([print_link(d) for d in links])
loop.run_until_complete(f) 
Was going to be a simple way to rip MP3s from coub (the links are buried in JSON embedded in the HTML)
(Nov 12, 2015 12:35 PM)Baba Yaga Wrote:  Thank you 🙂

Also, do you know how to make the script multithreaded? Haven't tried my hand at that yet and Im not really sure how to implement it

No need to multithread, python doesn't give you any speed improvement from multithreading because it is all internally one thread, you only use multithreading when you actually need multiple threads running concurrently, like in a server


Possibly Related Threads...
Thread / Author Replies Views Last Post
[.NET] by Hacker_AdiJul 21, 2012 04:40 AM 31 1,544 Jul 21, 2012 04:40 AM
Last Post: Mazaki
[.NET] by Hacker_AdiMar 18, 2012 06:58 AM 23 1,031 Mar 18, 2012 06:58 AM
Last Post: Sakozi
[.NET] by PulserMay 3, 2011 08:23 AM 51 825 May 3, 2011 08:23 AM
Last Post: Ups.