|
|
@@ -0,0 +1,66 @@ |
|
|
#! /usr/bin/env python |
|
|
# -*- coding: utf-8 -*- |
|
|
# |
|
|
# vim: fenc=utf-8 |
|
|
# vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 |
|
|
# |
|
|
# |
|
|
|
|
|
""" |
|
|
File name: twoo.py |
|
|
Version: 0.1 |
|
|
Author: dhilipsiva <[email protected]> |
|
|
Date created: 2015-08-19 |
|
|
""" |
|
|
__author__ = "dhilipsiva" |
|
|
__status__ = "development" |
|
|
|
|
|
""" |
|
|
Script to spam twoo users. |
|
|
Because: https://twitter.com/dhilipsiva/status/633956046969569280 |
|
|
""" |
|
|
|
|
|
import requests |
|
|
from pyquery import PyQuery as pq |
|
|
|
|
|
base_url = "http://www.twoo.com" |
|
|
start_url = "%s/search?page=49" % base_url |
|
|
messages_endpoint = "http://www.twoo.com/messages/" |
|
|
|
|
|
cookies = dict( |
|
|
tw_twoo_lng="en", |
|
|
userCountMax="173748971", |
|
|
tw_ses="<Twoo Session>", |
|
|
tw_c="<Twoo Cookie>", |
|
|
tw_loginemail="<TWOO Email Token>", |
|
|
tw_login1="<Twoo Login Token>", |
|
|
) |
|
|
|
|
|
|
|
|
def get_page(url): |
|
|
""" |
|
|
docstring for get_page |
|
|
""" |
|
|
print "Getting List: ", url |
|
|
resp = requests.get(url, cookies=cookies) |
|
|
d = pq(resp.content) |
|
|
url = None |
|
|
for el in d(".card--gridFlex"): |
|
|
d1 = pq(el) |
|
|
profile_id = d1(".jsCard").attr("id") |
|
|
if not profile_id: |
|
|
continue |
|
|
profile_id = profile_id.replace("profile_", "") |
|
|
data = dict( |
|
|
twoo_csrf_token="<TWOO CSRF Token Here>", |
|
|
action="send", view="normal", receiver=profile_id, r="", s="", |
|
|
logAction="", type="", gift="", yttitle="", ytartist="", |
|
|
message="Hi, I am `dhilipsiva` http://dhilipsiva.com" |
|
|
) |
|
|
print " Sending Message: %s" % profile_id |
|
|
requests.post(messages_endpoint, data=data, cookies=cookies) |
|
|
a = d(".pager__item.last").attr("href") |
|
|
if a: |
|
|
get_page(base_url + a) |
|
|
|
|
|
get_page(start_url) |