Skip to content

Instantly share code, notes, and snippets.

@dhilipsiva
Last active August 9, 2022 03:29
Show Gist options
  • Save dhilipsiva/75761dc6d2d3dda579f2 to your computer and use it in GitHub Desktop.
Save dhilipsiva/75761dc6d2d3dda579f2 to your computer and use it in GitHub Desktop.
Spam Twoo Users
getPage = (url) ->
$.get url
.done (response, success, xhr) ->
results = $ JSON.parse(response).html
for result in results.find ".card--gridFlex"
d1 = $ result
profile_id = d1.find(".jsCard").attr "id"
continue if !profile_id
profile_id = profile_id.replace "profile_", ""
data =
twoo_csrf_token: $("input[name='twoo_csrf_token']").val()
action: "send"
view: "normal"
receiver: profile_id
message: "Hi, I am `dhilipsiva` http://dhilipsiva.com"
$.post "/messages/", data
getPage results.find(".pager__item.last").attr "href"
getPage "/search?page=1"
var getPage;
getPage = function(url) {
return $.get(url).done(function(response, success, xhr) {
var d1, data, i, len, profile_id, ref, result, results;
results = $(JSON.parse(response).html);
ref = results.find(".card--gridFlex");
for (i = 0, len = ref.length; i < len; i++) {
result = ref[i];
d1 = $(result);
profile_id = d1.find(".jsCard").attr("id");
if (!profile_id) {
continue;
}
profile_id = profile_id.replace("profile_", "");
data = {
twoo_csrf_token: $("input[name='twoo_csrf_token']").val(),
action: "send",
view: "normal",
receiver: profile_id,
message: "Hi, I am `dhilipsiva` http://dhilipsiva.com"
};
$.post("/messages/", data);
}
return getPage(results.find(".pager__item.last").attr("href"));
});
};
getPage("/search?page=1");
var getPage;getPage=function(a){return $.get(a).done(function(a){var d,e,f,g,h,i,j,k;for(k=$(JSON.parse(a).html),i=k.find(".card--gridFlex"),f=0,g=i.length;g>f;f++)j=i[f],d=$(j),h=d.find(".jsCard").attr("id"),h&&(h=h.replace("profile_",""),e={twoo_csrf_token:$("input[name='twoo_csrf_token']").val(),action:"send",view:"normal",receiver:h,message:"Hi, I am `dhilipsiva` http://dhilipsiva.com"},$.post("/messages/",e));return getPage(k.find(".pager__item.last").attr("href"))})},getPage("/search?page=1");
#! /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=1" % base_url
messages_endpoint = "%s/messages/" % base_url
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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment