Tree @5315caf (Download .tar.gz)
- ..
- __init__.py
- abou.py
- about.py
- affilorama.py
- ahmia.py
- anarchy101.py
- angel.py
- archive.py
- arduino.py
- ariva.py
- armorgames.py
- askfm.py
- audiob.py
- audioboo.py
- authorstream.py
- autospies.py
- badoo.py
- bandcamp.py
- bebee.py
- behance.py
- bennugd.py
- betblog.py
- bitbucket.py
- bitcointa.py
- bitcointalk.py
- bitly.py
- bitrated.py
- blackplanet.py
- blip.py
- blogmarks.py
- blogspot.py
- bookofmatches.py
- boonex.py
- bordom.py
- boxedup.py
- breakcom.py
- bubok.py
- bucketlistly.py
- buddypic.py
- burbuja.py
- burdastyle.py
- buzznet.py
- cafemom.py
- canva.py
- carbonmade.py
- cardinghispano.py
- cardingmx.py
- cardomain.py
- care2.py
- cartodb.py
- cash.py
- castroller.py
- causes.py
- ccm.py
- ccsinfo.py
- chess.py
- cockos.py
- codecademy.py
- codementor.py
- coderwall.py
- coinbase.py
- colourlovers.py
- connectingsingles.py
- contently.py
- couchsurfing.py
- crokes.py
- crowdin.py
- cryptofresh.py
- dailymotion.py
- datpiff.py
- deviantart.py
- digitalspy.py
- disqus.py
- doodle.py
- douban.py
- dreamstime.py
- dribbble.py
- drugbuyersforum.py
- drupal.py
- dzone.py
- ebay.py
- echatta.py
- ehow.py
- eightbitme.py
- ello.py
- elmundo.py
- emoneyspace.py
- enfemenino.py
- ethereum.py
- etsy.py
- eyeem.py
- f6s.py
- facebook.py
- facesaerch.py
- fanpop.py
- fark.py
- favstar.py
- fiverr.py
- flickr.py
- flixster.py
- foodspotting.py
- forobtc.py
- forocoches.py
- foroptc.py
- foros24h.py
- forosperu.py
- forospyware.py
- fotolog.py
- foursquare.py
- freelancer.py
- freerepublic.py
- gamesheep.py
- gametracker.py
- gapyear.py
- gather.py
- geeksphone.py
- genspot.py
- getlocalization.py
- getsatisfaction.py
- github.py
- goblinrefuge.py
- goodreads.py
- googleplus.py
- gravatar.py
- gsmspain.py
- hi5.py
- houzz.py
- htcmania.py
- hubpages.py
- ibosocial.py
- identica.py
- ifunny.py
- imgur.py
- infotelefonica.py
- inkonsky.py
- instagram.py
- instructables.py
- intfiction.py
- islamicawakening.py
- issuu.py
- ivoox.py
- jamiiforums.py
- kali.py
- kanogames.py
- karmacracy.py
- keybase.py
- kickstarter.py
- kimatel.py
- kinja.py
- kiwi.py
- klout.py
- kongregate.py
- kupika.py
- lastfm.py
- leakforums.py
- linkedin.py
- listaspam.py
- livejournal.py
- looki.py
- losviajeros.py
- marca.py
- matchdoctor.py
- mcneel.py
- mediavida.py
- medium.py
- meneame.py
- mercadolibre.py
- metacafe.py
- meteor.py
- mig.py
- migente.py
- miiverse.py
- minecraft.py
- moneymaker.py
- mozilla.py
- musicasacra.py
- myeloma.py
- myfitnesspal.py
- myspace.py
- nairaland.py
- netlog.py
- netvibes.py
- newgrounds.py
- notablug.py
- occupywallst.py
- odnoklassniki.py
- okcupid.py
- onename.py
- openbugbounty.py
- openframeworks.py
- openstreetmap.py
- papaly.py
- pastebin.py
- patreon.py
- pearltrees.py
- peerbackers.py
- periscope.py
- pgpmit.py
- phishtank.py
- photobucket.py
- pixinsight.py
- pixls.py
- pjrc.py
- pokerred.py
- pokerstrategy.py
- pornhub.py
- proboards.py
- px500.py
- pz.py
- qq.py
- quartermoonsaloon.py
- rankia.py
- rapid7.py
- rapid_i.py
- ratemypoo.py
- realcarders.py
- rebelmouse.py
- reddit.py
- redtube.py
- researchgate.py
- reverbnation.py
- ripenear.py
- rojadirecta.py
- ruby.py
- sarahah.py
- scribd.py
- seatwish.py
- sencha.py
- sidereel.py
- singletrackworld.py
- skype.py
- slashdot.py
- slideshare.py
- smartcitizen.py
- smugmug.py
- soundcloud.py
- soup.py
- sourceforge.py
- spaniards.py
- spoj.py
- spotify.py
- spreaker.py
- squidoo.py
- steamcommunity.py
- steemit.py
- steinberg.py
- streakgaming.py
- taringa.py
- teamtreehouse.py
- techcrunch.py
- technorati.py
- thehoodup.py
- thesims.py
- thestudentroom.py
- theverge.py
- tipme.py
- tradimo.py
- trakt.py
- translate_hola.py
- trip.py
- tripadvisor.py
- tripit.py
- trulia.py
- tumblr.py
- tune.py
- tuporno.py
- twicsy.py
- twitch.py
- twitter.py
- twoplustwo.py
- typepad.py
- unioncarder.py
- ustream.py
- v7n.py
- venmo.py
- vexforum.py
- viddler.py
- videohelp.py
- vimeo.py
- virustotal.py
- vk.py
- warriorforum.py
- webtv.py
- wikia.py
- wikipediaar.py
- wikipediaca.py
- wikipediade.py
- wikipediaen.py
- wikipediaes.py
- wikipediaeu.py
- wikipediafr.py
- wikipediapt.py
- winamp.py
- wishlistr.py
- witty.py
- wykop.py
- xanga.py
- xing.py
- xtube.py
- younow.py
- youtube.py
- zabbix.py
- zentyal.py
- zotero.py
twitter.py @5315caf — raw · history · blame
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 | # !/usr/bin/python
# -*- coding: cp1252 -*-
#
##################################################################################
#
# Copyright 2016 FĂ©lix Brezo and Yaiza Rubio (i3visio, [email protected])
#
# This program is part of OSRFramework. You can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##################################################################################
import argparse
import json
import re
import sys
import urllib2
import osrframework.utils.browser as browser
from osrframework.utils.platforms import Platform
# Importing the API Wrapper
from osrframework.api.twitter_api import TwitterAPIWrapper as TwitterAPIWrapper
class Twitter(Platform):
"""
A <Platform> object for Twitter.
"""
def __init__(self):
'''
Constructor...
'''
self.platformName = "Twitter"
self.tags = ["contact", "microblogging", "social"]
# Base URL
self.baseURL = "http://twitter.com/"
# Trying to find an API... This line should be added in every platform for which we have defined an API.
# DO NOT FORGET TO IMPORT THE APIWRAPPER, i. e.:
# from osrframework.api import TwitterAPIWrapper as TwitterAPIWrapper
try:
self.wrapperAPI = TwitterAPIWrapper()
except Exception, e:
self.wrapperAPI = None
########################
# Defining valid modes #
########################
self.isValidMode = {}
self.isValidMode["phonefy"] = False
self.isValidMode["usufy"] = True
self.isValidMode["searchfy"] = True
######################################
# Search URL for the different modes #
######################################
# Strings with the URL for each and every mode
self.url = {}
#self.url["phonefy"] = "http://anyurl.com//phone/" + "<phonefy>"
self.url["usufy"] = "http://twitter.com/" + "<usufy>"
self.url["searchfy"] = "https://twitter.com/search?f=users&vertical=default&q=\"" + "<searchfy>" + "\""
######################################
# Whether the user needs credentials #
######################################
self.needsCredentials = {}
#self.needsCredentials["phonefy"] = False
self.needsCredentials["usufy"] = False
self.needsCredentials["searchfy"] = False
#################
# Valid queries #
#################
# Strings that will imply that the query number is not appearing
self.validQuery = {}
# The regular expression '.+' will match any query.
#self.validQuery["phonefy"] = ".*"
self.validQuery["usufy"] = "[a-zA-Z0-9_]+"
self.validQuery["searchfy"] = ".+"
###################
# Not_found clues #
###################
# Strings that will imply that the query number is not appearing
self.notFoundText = {}
#self.notFoundText["phonefy"] = []
self.notFoundText["usufy"] = ["<form class=\"search-404\""]
self.notFoundText["searchfy"] = []
#########################
# Fields to be searched #
#########################
self.fieldsRegExp = {}
# Definition of regular expressions to be searched in phonefy mode
#self.fieldsRegExp["phonefy"] = {}
# Example of fields:
#self.fieldsRegExp["phonefy"]["i3visio.location"] = ""
# Definition of regular expressions to be searched in usufy mode
self.fieldsRegExp["usufy"] = {}
# Examples (do NOT forget to escape the quoting marks inside any string: \"):
self.fieldsRegExp["usufy"]["@protected"] = {"start": "data-protected=\"", "end": "\">\n <span class=\"UserActions"}
self.fieldsRegExp["usufy"]["i3visio.fullname"] = {"start": "class=\"ProfileHeaderCard-nameLink u-textInheritColor js-nav\n\">", "end": "</a>\n </h1>"}
#self.fieldsRegExp["usufy"]["ProfileHeaderCard-bio"] = {"start": "<p class=\"ProfileHeaderCard-bio u-dir\"\n \n dir=\"ltr\">", "end": "</p>"}
self.fieldsRegExp["usufy"]["i3visio.location"] = {"start": "<span class=\"ProfileHeaderCard-locationText u-dir\" dir=\"ltr\">\n ", "end": "\n </span>\n </div>\n\n <div class=\"ProfileHeaderCard-url"}
self.fieldsRegExp["usufy"]["@created_at"] = {"start": "<span class=\"ProfileHeaderCard-joinDateText js-tooltip u-dir\" dir=\"ltr\" title=\"", "end": "\">Se uni"}
self.fieldsRegExp["usufy"]["i3visio.uri.homepage"] = {"start": "<span class=\"ProfileHeaderCard-urlText u-dir\" dir=\"ltr\"><a class=\"u-textUserColor\" target=\"_blank\" rel=\"me nofollow\" href=\"[^\"]*\" title=\"", "end": "\">"}
#self.fieldsRegExp["usufy"]["PhotoRail-headingText"] = {"start": "class=\"js-nav\">\n \n ", "end": " </a>"}
# Definition of regular expressions to be searched in searchfy mode
self.fieldsRegExp["searchfy"] = {}
self.searchfyAliasRegexp = "data-screen-name=\"([^\"]+)\""
# Example of fields:
#self.fieldsRegExp["searchfy"]["i3visio.location"] = ""
################
# Fields found #
################
# This attribute will be feeded when running the program.
self.foundFields = {}
|