A copyright violation detector running on Wikimedia Cloud Services https://tools.wmflabs.org/copyvios/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

62 lines
2.3 KiB

  1. <%!
  2. from sys import path
  3. from urlparse import parse_qs
  4. path.insert(0, "../earwigbot")
  5. import earwigbot
  6. %>\
  7. <%
  8. query = parse_qs(environ["QUERY_STRING"])
  9. try:
  10. lang = query["lang"][0]
  11. project = query["project"][0]
  12. title = query["title"][0]
  13. except (KeyError, IndexError):
  14. page = None
  15. else:
  16. earwigbot.config.config.load("config.ts-earwigbot.json")
  17. try:
  18. site = earwigbot.wiki.get_site(lang=lang, project=project)
  19. except earwigbot.wiki.SiteNotFoundError:
  20. page = None
  21. else:
  22. page = site.get_page(title)
  23. %>\
  24. <%include file="/support/header.mako" args="environ=environ, title='Copyvio Detector'"/>
  25. <h1>Copyvio Detector</h1>
  26. <p>This tool attempts to detect <a href="http://en.wikipedia.org/wiki/WP:COPYVIO">copyright violations</a> in Wikipedia articles.</p>
  27. <form action="${environ['PATH_INFO']}" method="get">
  28. <table>
  29. <tr>
  30. <td>Site:</td>
  31. <td>
  32. <select name="lang">
  33. <option value="en" selected="selected">en (English)</option>
  34. </select>
  35. <select name="project">
  36. <option value="wikipedia" selected="selected">Wikipedia</option>
  37. </select>
  38. </td>
  39. </tr>
  40. <tr>
  41. <td>Page title:</td>
  42. % if page:
  43. <td><input type="text" name="title" size="50" value="${page.title()}" /></td>
  44. % else:
  45. <td><input type="text" name="title" size="50" /></td>
  46. % endif
  47. </tr>
  48. <tr>
  49. <td><button type="submit">Submit</button></td>
  50. </tr>
  51. </table>
  52. </form>
  53. % if page:
  54. <fieldset id="result">
  55. <legend>Result for <a href="${page.url()}">${page.title()}</a>:</legend>
  56. <p>Watch this space!</p>
  57. </fieldset>
  58. % endif
  59. <%include file="/support/footer.mako" args="environ=environ"/>