Giter Club home page Giter Club logo

ivdiff's Introduction

ivdiff

scripts to get difference between two Instant View templates

Installing

Install python3 and pip. Then run git clone https://github.com/undrfined/ivdiff; cd ivdiff; pip install -r requirements.txt.

Auth

To authenticate run script auth.py:

py auth.py +38093******6

...and you're ready to go.

ivdiff.py

get diff for one specific page

usage:

py ivdiff.py <Template> <Template> <URL> [-c <cookies file>] [-b <browser>]

...where <Template> is a template number if it was submitted to contest (for example 45) or filename with the template code(for example file.xpath). Also you can use ~ to download current code from My Templates section.

Please do a backup of your code before using filename or ~ as one of the templates

<URL> is an URL to diff.

<browser> is a browser name (according to docs) or path to program to open file

batchdiff.py

get diff for a lot of pages from file

usage:

py batchdiff.py <Template> <Template> <List of URLs> [-c <cookies file>] [-p <pool size>]

...where <List of URLs> is a filename with list of all the urls you want to diff and <pool size> is count of threads you want to use (default 5)

spider.py

collect all the URLs automatically and get diff for all of them

usage:

py spider.py <Template> <Template> <domain> [-c <cookies file>] [-p <pool size>] [-b <browser>] [-w <whitelist>] [-r <restrict xpath>]

...where <domain> is a domain name (for example 5minutes.rtl.lu)

<browser> is a browser name (according to docs) or path to program to open file

<whitelist> is a list of xpathes that will be checked in the IV.

<restrict xpath> you guessed it, restricts xpathes to be checked in the IV

checked.py

press "Mark as checked" for all the links in the domain.

usage:

py checked.py <domain> [-c <cookies file>]

Please do a backup of your code before using this

backup.py

downloads all the templates

usage:

py backup.py [-c <cookies file>]

cdo, do and other awesome macros for diff

You can use macros inside of your IV template code to diff more easily. There are three types of macros:

  • ##do [(alias OR template number) list separated with space OR nothing], means "do this block of code for diff only"
  • ##cdo [(alias OR template number) list separated with space OR nothing], means "comment out this block of code for diff only"
  • ##s [alias] [template number], means "set alias to template number"

Example usage:

##s undrfined 10 (set alias "undrfined" to template number 10. don't forget to update it tho!)

##do undrfined Vlad 111 (use this code block only when diffing with undrfined or Vlad or template#111)
@datetime: //body/time
published_date: $@
##? (means else, do this block for every other diff)
published_date: //meta[@property="date"]/@content
##

ivdiff will automatically comment out all the code when you'll start diffing with other template.

ivdiff.py#compare()

You can use this method if you want to remove some elements that exist in one template but are missing in another. Or you can convert them somehow to match other contestant's template.

Linux & Mac OS

..are not supported because I didn't test it there ๐Ÿคทโ€โ™‚๏ธ

Delayed [issues] service

Sends issue in the last second. Yeah, shame on me! Install delayed_userscript.js in the tampermonkey, then run service itself: py delayed_service.py.

It's not only about evil

Delayed service actually has a lot more useful features. I don't remember any of them though, so that would be a surprise for you :)

ivdiff's People

Contributors

undrfined avatar zubiden avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.