- 
      
- 
        Save emdeeeks/cc6fbae17a5ed34e9abe to your computer and use it in GitHub Desktop. 
    Spam Twoo Users
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | #! /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