Fix https links when available, everywhere
This commit is contained in:
parent
99384ad6f7
commit
e0d7ef1314
@ -10,7 +10,7 @@ Requirements
|
|||||||
*nemubot* requires at least Python 3.3 to work.
|
*nemubot* requires at least Python 3.3 to work.
|
||||||
|
|
||||||
Some modules (like `cve`, `nextstop` or `laposte`) require the
|
Some modules (like `cve`, `nextstop` or `laposte`) require the
|
||||||
[BeautifulSoup module](http://www.crummy.com/software/BeautifulSoup/),
|
[BeautifulSoup module](https://www.crummy.com/software/BeautifulSoup/),
|
||||||
but the core and framework has no dependency.
|
but the core and framework has no dependency.
|
||||||
|
|
||||||
|
|
||||||
|
@ -36,7 +36,7 @@ for k, v in s:
|
|||||||
# MODULE CORE #########################################################
|
# MODULE CORE #########################################################
|
||||||
|
|
||||||
def get_conjug(verb, stringTens):
|
def get_conjug(verb, stringTens):
|
||||||
url = ("http://leconjugueur.lefigaro.fr/conjugaison/verbe/%s.html" %
|
url = ("https://leconjugueur.lefigaro.fr/conjugaison/verbe/%s.html" %
|
||||||
quote(verb.encode("ISO-8859-1")))
|
quote(verb.encode("ISO-8859-1")))
|
||||||
page = web.getURLContent(url)
|
page = web.getURLContent(url)
|
||||||
|
|
||||||
|
@ -13,7 +13,7 @@ from nemubot.module.more import Response
|
|||||||
|
|
||||||
# GLOBALS #############################################################
|
# GLOBALS #############################################################
|
||||||
|
|
||||||
URL_API = "http://open.mapquestapi.com/geocoding/v1/address?key=%s&location=%%s"
|
URL_API = "https://open.mapquestapi.com/geocoding/v1/address?key=%s&location=%%s"
|
||||||
|
|
||||||
|
|
||||||
# LOADING #############################################################
|
# LOADING #############################################################
|
||||||
@ -23,7 +23,7 @@ def load(context):
|
|||||||
raise ImportError("You need a MapQuest API key in order to use this "
|
raise ImportError("You need a MapQuest API key in order to use this "
|
||||||
"module. Add it to the module configuration file:\n"
|
"module. Add it to the module configuration file:\n"
|
||||||
"<module name=\"mapquest\" key=\"XXXXXXXXXXXXXXXX\" "
|
"<module name=\"mapquest\" key=\"XXXXXXXXXXXXXXXX\" "
|
||||||
"/>\nRegister at http://developer.mapquest.com/")
|
"/>\nRegister at https://developer.mapquest.com/")
|
||||||
global URL_API
|
global URL_API
|
||||||
URL_API = URL_API % context.config["apikey"].replace("%", "%%")
|
URL_API = URL_API % context.config["apikey"].replace("%", "%%")
|
||||||
|
|
||||||
|
@ -11,7 +11,7 @@ def isup(url):
|
|||||||
|
|
||||||
o = urllib.parse.urlparse(getNormalizedURL(url), "http")
|
o = urllib.parse.urlparse(getNormalizedURL(url), "http")
|
||||||
if o.netloc != "":
|
if o.netloc != "":
|
||||||
isup = getJSON("http://isitup.org/%s.json" % o.netloc)
|
isup = getJSON("https://isitup.org/%s.json" % o.netloc)
|
||||||
if isup is not None and "status_code" in isup and isup["status_code"] == 1:
|
if isup is not None and "status_code" in isup and isup["status_code"] == 1:
|
||||||
return isup["response_time"]
|
return isup["response_time"]
|
||||||
|
|
||||||
|
@ -17,7 +17,7 @@ def validator(url):
|
|||||||
raise IMException("Indicate a valid URL!")
|
raise IMException("Indicate a valid URL!")
|
||||||
|
|
||||||
try:
|
try:
|
||||||
req = urllib.request.Request("http://validator.w3.org/check?uri=%s&output=json" % (urllib.parse.quote(o.geturl())), headers={ 'User-Agent' : "Nemubot v%s" % __version__})
|
req = urllib.request.Request("https://validator.w3.org/check?uri=%s&output=json" % (urllib.parse.quote(o.geturl())), headers={ 'User-Agent' : "Nemubot v%s" % __version__})
|
||||||
raw = urllib.request.urlopen(req, timeout=10)
|
raw = urllib.request.urlopen(req, timeout=10)
|
||||||
except urllib.error.HTTPError as e:
|
except urllib.error.HTTPError as e:
|
||||||
raise IMException("HTTP error occurs: %s %s" % (e.code, e.reason))
|
raise IMException("HTTP error occurs: %s %s" % (e.code, e.reason))
|
||||||
|
@ -9,7 +9,7 @@ from nemubot.tools.web import getJSON
|
|||||||
from nemubot.module.more import Response
|
from nemubot.module.more import Response
|
||||||
|
|
||||||
URL_AVAIL = "https://www.whoisxmlapi.com/whoisserver/WhoisService?cmd=GET_DN_AVAILABILITY&domainName=%%s&outputFormat=json&username=%s&password=%s"
|
URL_AVAIL = "https://www.whoisxmlapi.com/whoisserver/WhoisService?cmd=GET_DN_AVAILABILITY&domainName=%%s&outputFormat=json&username=%s&password=%s"
|
||||||
URL_WHOIS = "http://www.whoisxmlapi.com/whoisserver/WhoisService?da=2&domainName=%%s&outputFormat=json&userName=%s&password=%s"
|
URL_WHOIS = "https://www.whoisxmlapi.com/whoisserver/WhoisService?da=2&domainName=%%s&outputFormat=json&userName=%s&password=%s"
|
||||||
|
|
||||||
|
|
||||||
# LOADING #############################################################
|
# LOADING #############################################################
|
||||||
@ -22,7 +22,7 @@ def load(CONF, add_hook):
|
|||||||
"the !netwhois feature. Add it to the module "
|
"the !netwhois feature. Add it to the module "
|
||||||
"configuration file:\n<whoisxmlapi username=\"XX\" "
|
"configuration file:\n<whoisxmlapi username=\"XX\" "
|
||||||
"password=\"XXX\" />\nRegister at "
|
"password=\"XXX\" />\nRegister at "
|
||||||
"http://www.whoisxmlapi.com/newaccount.php")
|
"https://www.whoisxmlapi.com/newaccount.php")
|
||||||
|
|
||||||
URL_AVAIL = URL_AVAIL % (urllib.parse.quote(CONF.getNode("whoisxmlapi")["username"]), urllib.parse.quote(CONF.getNode("whoisxmlapi")["password"]))
|
URL_AVAIL = URL_AVAIL % (urllib.parse.quote(CONF.getNode("whoisxmlapi")["username"]), urllib.parse.quote(CONF.getNode("whoisxmlapi")["password"]))
|
||||||
URL_WHOIS = URL_WHOIS % (urllib.parse.quote(CONF.getNode("whoisxmlapi")["username"]), urllib.parse.quote(CONF.getNode("whoisxmlapi")["password"]))
|
URL_WHOIS = URL_WHOIS % (urllib.parse.quote(CONF.getNode("whoisxmlapi")["username"]), urllib.parse.quote(CONF.getNode("whoisxmlapi")["password"]))
|
||||||
|
@ -40,7 +40,7 @@ def cmd_subreddit(msg):
|
|||||||
else:
|
else:
|
||||||
where = "r"
|
where = "r"
|
||||||
|
|
||||||
sbr = web.getJSON("http://www.reddit.com/%s/%s/about.json" %
|
sbr = web.getJSON("https://www.reddit.com/%s/%s/about.json" %
|
||||||
(where, sub.group(2)))
|
(where, sub.group(2)))
|
||||||
|
|
||||||
if sbr is None:
|
if sbr is None:
|
||||||
|
@ -25,7 +25,7 @@ def cmd_tcode(msg):
|
|||||||
raise IMException("indicate a transaction code or "
|
raise IMException("indicate a transaction code or "
|
||||||
"a keyword to search!")
|
"a keyword to search!")
|
||||||
|
|
||||||
url = ("http://www.tcodesearch.com/tcodes/search?q=%s" %
|
url = ("https://www.tcodesearch.com/tcodes/search?q=%s" %
|
||||||
urllib.parse.quote(msg.args[0]))
|
urllib.parse.quote(msg.args[0]))
|
||||||
|
|
||||||
page = web.getURLContent(url)
|
page = web.getURLContent(url)
|
||||||
|
@ -53,7 +53,7 @@ def get_french_synos(word):
|
|||||||
|
|
||||||
|
|
||||||
def get_english_synos(key, word):
|
def get_english_synos(key, word):
|
||||||
cnt = web.getJSON("http://words.bighugelabs.com/api/2/%s/%s/json" %
|
cnt = web.getJSON("https://words.bighugelabs.com/api/2/%s/%s/json" %
|
||||||
(quote(key), quote(word.encode("ISO-8859-1"))))
|
(quote(key), quote(word.encode("ISO-8859-1"))))
|
||||||
|
|
||||||
best = list(); synos = list(); anton = list()
|
best = list(); synos = list(); anton = list()
|
||||||
|
@ -14,7 +14,7 @@ from nemubot.module.more import Response
|
|||||||
|
|
||||||
def search(terms):
|
def search(terms):
|
||||||
return web.getJSON(
|
return web.getJSON(
|
||||||
"http://api.urbandictionary.com/v0/define?term=%s"
|
"https://api.urbandictionary.com/v0/define?term=%s"
|
||||||
% quote(' '.join(terms)))
|
% quote(' '.join(terms)))
|
||||||
|
|
||||||
|
|
||||||
|
@ -15,7 +15,7 @@ from nemubot.module import mapquest
|
|||||||
|
|
||||||
# GLOBALS #############################################################
|
# GLOBALS #############################################################
|
||||||
|
|
||||||
URL_API = "http://public-api.adsbexchange.com/VirtualRadar/AircraftList.json?fcallC=%s"
|
URL_API = "https://public-api.adsbexchange.com/VirtualRadar/AircraftList.json?fcallC=%s"
|
||||||
|
|
||||||
SPEED_TYPES = {
|
SPEED_TYPES = {
|
||||||
0: 'Ground speed',
|
0: 'Ground speed',
|
||||||
|
@ -59,7 +59,7 @@ def load(context):
|
|||||||
raise ImportError("You need a Dark-Sky API key in order to use this "
|
raise ImportError("You need a Dark-Sky API key in order to use this "
|
||||||
"module. Add it to the module configuration file:\n"
|
"module. Add it to the module configuration file:\n"
|
||||||
"<module name=\"weather\" darkskyapikey=\"XXX\" />\n"
|
"<module name=\"weather\" darkskyapikey=\"XXX\" />\n"
|
||||||
"Register at http://developer.forecast.io/")
|
"Register at https://developer.forecast.io/")
|
||||||
context.data.setIndex("name", "city")
|
context.data.setIndex("name", "city")
|
||||||
global URL_DSAPI
|
global URL_DSAPI
|
||||||
URL_DSAPI = URL_DSAPI % context.config["darkskyapikey"]
|
URL_DSAPI = URL_DSAPI % context.config["darkskyapikey"]
|
||||||
|
@ -15,7 +15,7 @@ from nemubot.module.more import Response
|
|||||||
|
|
||||||
# LOADING #############################################################
|
# LOADING #############################################################
|
||||||
|
|
||||||
URL_API = "http://api.wolframalpha.com/v2/query?input=%%s&format=plaintext&appid=%s"
|
URL_API = "https://api.wolframalpha.com/v2/query?input=%%s&format=plaintext&appid=%s"
|
||||||
|
|
||||||
def load(context):
|
def load(context):
|
||||||
global URL_API
|
global URL_API
|
||||||
@ -24,7 +24,7 @@ def load(context):
|
|||||||
"this module. Add it to the module configuration: "
|
"this module. Add it to the module configuration: "
|
||||||
"\n<module name=\"wolframalpha\" "
|
"\n<module name=\"wolframalpha\" "
|
||||||
"apikey=\"XXXXXX-XXXXXXXXXX\" />\n"
|
"apikey=\"XXXXXX-XXXXXXXXXX\" />\n"
|
||||||
"Register at http://products.wolframalpha.com/api/")
|
"Register at https://products.wolframalpha.com/api/")
|
||||||
URL_API = URL_API % quote(context.config["apikey"]).replace("%", "%%")
|
URL_API = URL_API % quote(context.config["apikey"]).replace("%", "%%")
|
||||||
|
|
||||||
|
|
||||||
|
@ -135,7 +135,7 @@ class Bot(threading.Thread):
|
|||||||
"Vous pouvez le consulter, le dupliquer, "
|
"Vous pouvez le consulter, le dupliquer, "
|
||||||
"envoyer des rapports de bogues ou bien "
|
"envoyer des rapports de bogues ou bien "
|
||||||
"contribuer au projet sur GitHub : "
|
"contribuer au projet sur GitHub : "
|
||||||
"http://github.com/nemunaire/nemubot/")
|
"https://github.com/nemunaire/nemubot/")
|
||||||
res.append_message(title="Pour plus de détails sur un module, "
|
res.append_message(title="Pour plus de détails sur un module, "
|
||||||
"envoyez \"!help nomdumodule\". Voici la liste"
|
"envoyez \"!help nomdumodule\". Voici la liste"
|
||||||
" de tous les modules disponibles localement",
|
" de tous les modules disponibles localement",
|
||||||
|
@ -22,8 +22,8 @@ def factory(uri, ssl=False, **init_args):
|
|||||||
srv = None
|
srv = None
|
||||||
|
|
||||||
if o.scheme == "irc" or o.scheme == "ircs":
|
if o.scheme == "irc" or o.scheme == "ircs":
|
||||||
# http://www.w3.org/Addressing/draft-mirashi-url-irc-01.txt
|
# https://www.w3.org/Addressing/draft-mirashi-url-irc-01.txt
|
||||||
# http://www-archive.mozilla.org/projects/rt-messaging/chatzilla/irc-urls.html
|
# https://www-archive.mozilla.org/projects/rt-messaging/chatzilla/irc-urls.html
|
||||||
args = init_args
|
args = init_args
|
||||||
|
|
||||||
if o.scheme == "ircs": ssl = True
|
if o.scheme == "ircs": ssl = True
|
||||||
|
Loading…
Reference in New Issue
Block a user