# Path: tools/shorturl.py
# class ShortUrl:
#     def googl(url, api_key=None, logger=None):
#     def isgd(url, api_key=None, logger=None):
#     def scenesat(url, api_key=None, alias=None, password=None, logger=None):
# 
# Path: tools/urlparse.py
# RE_PROTOCOL = r"(?:([\w\-_]+?)(?::\/\/))?"  # (1) match the protocol, strip :// e.g. https or ssh
# RE_DOMAIN = r"([\w\-_\.]+)"  # (2) match the domain, and any subdomains. e.g. www.google, google, or maps.google
# RE_TLD = r"\.([a-z]{2,16})"  # (3) The top level domain, does not account for unicode. e.g. com, info, org
# RE_PORT = r"(?::(\+?[1-9]\d{1,4}))?"  # (4) The port. e.g. google.com:100 extracts 100
# RE_PATH = r"(\/[^ ]+)?"  # (5) Get everything after the top level domain / port starting with a slash. e.g. /hi.html
# URL_REGEX = re.compile(RE_PROTOCOL + RE_DOMAIN + RE_TLD + RE_PORT + RE_PATH, re.I)
#     CERTAINTY_CAP = 100
# class Url:
#     def __init__(self, url, min_certainty=50):
#     def getCertainty(self):
#     def getMinCertainty(self):
#     def getUrl(self):
#     def getProtocol(self):
#     def getSubdomains(self):
#     def getDomain(self):
#     def getPort(self):
#     def getTld(self):
#     def getPath(self):
#     def getFactors(self):
#     def getAsDict(self):
#     def find(string):
#     def findAll(string):
#     def isUrl(self):
#     def encode(self):
#     def decode(self):
#     def _parse(self):
#     def _calculateCertainty(self):
#     def _addCertainty(self, amount, factor):


import html
import bs4
import urllib.request
from tools import shorturl
from tools import urlparse
Copyright (c) 2014 - 2015 Jos "Zarthus" Ahrens and contributors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

UrlTools: Interact and manipulate URLs
"""




class UrlTools:
    SHORTEN_SERVICES = ["isgd", "googl", "scenesat"]

    def isUrl(url):

# Path: tools/shorturl.py
# class ShortUrl:
#     def googl(url, api_key=None, logger=None):
#     def isgd(url, api_key=None, logger=None):
#     def scenesat(url, api_key=None, alias=None, password=None, logger=None):
# 
# Path: tools/urlparse.py
# RE_PROTOCOL = r"(?:([\w\-_]+?)(?::\/\/))?"  # (1) match the protocol, strip :// e.g. https or ssh
# RE_DOMAIN = r"([\w\-_\.]+)"  # (2) match the domain, and any subdomains. e.g. www.google, google, or maps.google
# RE_TLD = r"\.([a-z]{2,16})"  # (3) The top level domain, does not account for unicode. e.g. com, info, org
# RE_PORT = r"(?::(\+?[1-9]\d{1,4}))?"  # (4) The port. e.g. google.com:100 extracts 100
# RE_PATH = r"(\/[^ ]+)?"  # (5) Get everything after the top level domain / port starting with a slash. e.g. /hi.html
# URL_REGEX = re.compile(RE_PROTOCOL + RE_DOMAIN + RE_TLD + RE_PORT + RE_PATH, re.I)
#     CERTAINTY_CAP = 100
# class Url:
#     def __init__(self, url, min_certainty=50):
#     def getCertainty(self):
#     def getMinCertainty(self):
#     def getUrl(self):
#     def getProtocol(self):
#     def getSubdomains(self):
#     def getDomain(self):
#     def getPort(self):
#     def getTld(self):
#     def getPath(self):
#     def getFactors(self):
#     def getAsDict(self):
#     def find(string):
#     def findAll(string):
#     def isUrl(self):
#     def encode(self):
#     def decode(self):
#     def _parse(self):
#     def _calculateCertainty(self):
#     def _addCertainty(self, amount, factor):


# Path: tools/urltools.py
import html
import bs4
import urllib.request
from tools import shorturl
from tools import urlparse

Copyright (c) 2014 - 2015 Jos "Zarthus" Ahrens and contributors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

UrlTools: Interact and manipulate URLs
"""




class UrlTools:
    SHORTEN_SERVICES = ["isgd", "googl", "scenesat"]

    def isUrl(url):

        return urlparse.Url(url).isUrl()