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
spoj.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 | # !/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
class Spoj(Platform):
"""
A <Platform> object for Spoj.
"""
def __init__(self):
"""
Constructor...
"""
self.platformName = "Spoj"
self.tags = ["social", "news"]
########################
# Defining valid modes #
########################
self.isValidMode = {}
self.isValidMode["phonefy"] = False
self.isValidMode["usufy"] = True
self.isValidMode["searchfy"] = False
######################################
# 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://www.spoj.com/users/" + "<usufy>"
#self.url["searchfy"] = "http://anyurl.com/search/" + "<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"] = ".+"
#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"] = [">History of submissions</a>"]
#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"] = {}
# Example of fields:
#self.fieldsRegExp["usufy"]["i3visio.location"] = ""
# Definition of regular expressions to be searched in searchfy mode
#self.fieldsRegExp["searchfy"] = {}
# Example of fields:
#self.fieldsRegExp["searchfy"]["i3visio.location"] = ""
################
# Fields found #
################
# This attribute will be feeded when running the program.
self.foundFields = {}
def somethingFound(self,data,mode="phonefy"):
'''
Verifying if something was found. Note that this method needed to be rewritten as in Spoj we need to look for a text which APPEARS instead of looking for a text that does NOT appear.
:param data: Data where the self.notFoundText will be searched.
:param mode: Mode to be executed.
:return: Returns True if exists.
'''
#try:
for text in self.notFoundText[mode]:
if text in data:
# This is the change with regards to the standard behaviour!
return True
return False
#except:
# pass
# # TO-DO: Throw notFoundText not found for this mode.
|