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":
@@ -17,13 +17,13 @@
% elif query.oldid and not result:
-

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!

% endif %endif

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.

-
+ @@ -123,7 +123,7 @@ % if result.cached:
  • Results are cached To save time (and money), this tool will retain the results of checks for up to 72 hours. This includes the URL of the "violated" source, but neither its content nor the content of the article. Future checks on the same page (assuming it remains unchanged) will not involve additional search queries, but a fresh comparison against the source URL will be made. If the page is modified, a new check will be run. - from ${result.cache_time} (${result.cache_age} ago). Bypass the cache.
  • + from ${result.cache_time} (${result.cache_age} ago). Bypass the cache. % else:
  • Results generated in ${round(result.time, 3)} seconds using ${result.queries} queries.
  • % endif diff --git a/templates/settings.mako b/templates/settings.mako index 05c145b..058f91d 100644 --- a/templates/settings.mako +++ b/templates/settings.mako @@ -9,7 +9,7 @@ % endif

    This page contains some configurable options for the copyvio detector. Settings are saved as cookies. You can view and delete all cookies generated by this site at the bottom of this page.

    - +
    Site:
    @@ -86,7 +86,7 @@ % endtry
    Default site:${cookie.value | h} - + @@ -96,7 +96,7 @@ % endfor
    - +