Skip to content

Commit

Permalink
Fix #263: Problem with searchfy on facebook
Browse files Browse the repository at this point in the history
Fix a long-term issue related to searchfy that was not collecting
properly profiles from there.
  • Loading branch information
i3visio committed Feb 4, 2018
1 parent 20af786 commit b2dc74d
Showing 1 changed file with 20 additions and 22 deletions.
42 changes: 20 additions & 22 deletions osrframework/wrappers/facebook.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,44 +30,44 @@
from osrframework.utils.platforms import Platform

class Facebook(Platform):
"""
"""
A <Platform> object for Facebook.
"""
def __init__(self):
"""
"""
Constructor...
"""
self.platformName = "Facebook"
self.tags = ["social", "contact"]

# Base URL
self.baseURL = "http://facebook.com/"

########################
# Defining valid modes #
########################
self.isValidMode = {}
self.isValidMode = {}
self.isValidMode["phonefy"] = False
self.isValidMode["usufy"] = True
self.isValidMode["searchfy"] = True
self.isValidMode["searchfy"] = True

######################################
# Search URL for the different modes #
######################################
# Strings with the URL for each and every mode
self.url = {}
self.url = {}
#self.url["phonefy"] = "http://anyurl.com//phone/" + "<phonefy>"
self.url["usufy"] = "https://www.facebook.com/" + "<usufy>"
self.url["searchfy"] = "https://www.facebook.com/public?query=" + "<searchfy>"
self.url["usufy"] = "https://www.facebook.com/" + "<usufy>"
self.url["searchfy"] = "https://www.facebook.com/public?query=" + "<searchfy>"

######################################
# Whether the user needs credentials #
######################################
self.needsCredentials = {}
self.needsCredentials = {}
#self.needsCredentials["phonefy"] = False
self.needsCredentials["usufy"] = False
self.needsCredentials["searchfy"] = False
self.needsCredentials["searchfy"] = False

#################
# Valid queries #
#################
Expand All @@ -77,40 +77,38 @@ def __init__(self):
#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"] = ["Esta página no está disponible", "This content is currently unavailable", "Sorry, this page isn't available"]
self.notFoundText["searchfy"] = []
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"] = {}
self.searchfyAliasRegexp = "lfloat _ohe\" href=\"https://www.facebook.com/([^\"]+)\" aria-hidden=\"true\""
self.searchfyAliasRegexp = "tabindex=\"-1\" href=\"https://www.facebook.com/([^\"]+)\">"
# Example of fields:
#self.fieldsRegExp["searchfy"]["i3visio.location"] = ""
#self.fieldsRegExp["searchfy"]["i3visio.location"] = ""

################
# Fields found #
################
# This attribute will be feeded when running the program.
self.foundFields = {}


0 comments on commit b2dc74d

Please sign in to comment.