I'm looking for a script to be written in PHP that will do the following:
The script will upvote reddit links from a database using accounts and proxies also contained in a database.
The following tables and fields are available for use in a database called "reddit":
"orders"
"id" - When a new row is added, an "id" is added that auto increments from the last "id" number.
"amount" - the number of upvotes needed to be delivered.
"redditlink" - the link on reddit that needs to be upvoted.
"startingvotes" - the number of votes the link had at the time it was added to the database.
"accounts"
"id" - When a new row is added, an "id" is added that auto increments from the last "id" number.
"username" - the account's username
"password" - the account's password
"proxies"
"id" - When a new row is added, an "id" is added that auto increments from the last "id" number.
"host" - the IP address for the proxy
"port" - the port number for the proxy
"lastused" - timestamp of the last time the proxy was used.
Sample tables:
proxies
id host port lastused
321924 [login to view URL] 8080 0
321923 [login to view URL] 8080 1305753241
321916 [login to view URL] 3128 1305751201
321915 [login to view URL] 8081 0
321914 [login to view URL] 80 0
321913 [login to view URL] 80 1305753002
321910 [login to view URL] 8080 1305752521
accounts
id username password
2363 WagesLowe4 s845vLQu
2364 AlexanderPrui CzyMOqGqK
2365 AlfaroWilliam kpCOQO06nLg
2366 AliciaRice UuK7NVZ97YCx
2367 AlmaWeaver szA6fRv0biv
2368 AmberHenry KUA0qzP5ncg
orders
id amount redditlink startingvotes
0 0 [login to view URL] 12
1 0 [login to view URL] 31
2 23 [login to view URL] 22
3 10 [login to view URL] 14
4 50 [login to view URL] 3
Please note that the links, accounts and proxies in the above sample tables are examples only and are not necessarily valid links, proxies or accounts.
Each time the script is run it will check the "orders" table for orders that need votes by checking the "amount" column for amounts > 0 and perform the following actions for each row where "amount" is >0.
1 - Get a random account from the "accounts" table.
2 - Get a random proxy from "proxies" that has not been used in the last four hours (checking the "lastused" value).
3 - Log into the account using the proxy and upvote the link from "orders"
4 - Verify that the link was successfully upvoted.
5 - If the link was successfully upvoted then deincrement the "amount" by one.
6 - Update the timestamp of the proxy to the current server time. (this should be done each time an upvote is attempted to be delivered regardless of whether or not it was successful.)
In the case that two or more orders with an "amount" > 0 exist the script should simply pick one of the eligible links at random to deliver the vote to.
Hello. Thanks for the detailed description. I have over 6 years experience with PHP and can do this for you, no problem. Available to start now, fast delivery guaranteed, reliable communication on IM/email until delivery. You'll get clean, efficient and well commented code that will do the job exactly as requested. Thanks.