diff --git a/copyvios/checker.py b/copyvios/checker.py index 4abca98..984507f 100644 --- a/copyvios/checker.py +++ b/copyvios/checker.py @@ -20,10 +20,13 @@ def do_check(): query.bot = get_bot() query.all_langs, query.all_projects = get_sites(query.bot) - if query.project and query.lang and query.title: # TODO: and (query.title or query.oldid): ... + if query.project and query.lang and (query.title or query.oldid): query.site = get_site(query) if query.site: - _get_results(query) + if query.title: + _get_results(query) + elif query.oldid: + pass return query def _get_results(query): diff --git a/copyvios/misc.py b/copyvios/misc.py index c7f226e..3bc7717 100644 --- a/copyvios/misc.py +++ b/copyvios/misc.py @@ -59,6 +59,11 @@ def open_sql_connection(bot, dbname): _connections[dbname] = conn return conn +def httpsfix(context, url): + if url.startswith("http://"): + url = url[len("http:"):] + return url + def urlstrip(context, url): if url.startswith("http://"): url = url[7:] diff --git a/templates/index.mako b/templates/index.mako index 7f33922..281efca 100644 --- a/templates/index.mako +++ b/templates/index.mako @@ -1,7 +1,7 @@ <%! from flask import g, request %>\ <%include file="/support/header.mako" args="title='Earwig\'s Copyvio Detector'"/> <%namespace module="copyvios.highlighter" import="highlight_delta"/>\ -<%namespace module="copyvios.misc" import="urlstrip"/>\ +<%namespace module="copyvios.misc" import="httpsfix, urlstrip"/>\ % if query.project and query.lang and (query.title or query.oldid): % if query.error == "bad URI":
The given revision ID doesn't seem to exist: ${query.oldid | h}.
+The given revision ID doesn't seem to exist: ${query.oldid | h}. Note: searching by revision IDs isn't supported just yet, but it will be soon. Sorry for the inconvenience!
This tool attempts to detect copyright violations in articles. Simply give the title of the page or ID of the revision you want to check and hit Submit. The tool will search for similar content elsewhere on the web using Yahoo! BOSS and then display a report if a match is found. If you give a URL, it will skip the search engine step and directly display a report comparing the article to that particular webpage, like the Duplication Detector.
Specific websites can be excluded from the check (for example, if their content is in the public domain) by being added to the excluded URL list.
-