GithubHelp home page GithubHelp logo

tochev / wikichanges Goto Github PK

View Code? Open in Web Editor NEW

This project forked from edsu/wikichanges

0.0 3.0 0.0 140 KB

a NodeJS library for monitoring changes on Wikipedia sites

Home Page: https://npmjs.org/package/wikichanges

wikichanges's Introduction

wikichanges

wikichanges is a node.js library for getting an edit stream from the 37 major language Wikipedias. The Wikipedia MediaWiki installations are configured to log changes in specific IRC channels. wikichanges joins all these channels, listens for updates, which it then parses, and sends as JavaScript objects to a callback of your choosing. Each change will look something like:

{ 
  channel: '#en.wikipedia',
  wikipedia: 'English Wikipedia',
  page: 'Persuasion (novel)',
  pageUrl: 'http://en.wikipedia.org/wiki/Persuasion_(novel)',
  url: 'http://en.wikipedia.org/w/index.php?diff=498770193&oldid=497895763',
  delta: -13,
  comment: '/* Main characters */',
  wikipediaUrl: 'http://en.wikipedia.org',
  user: '108.49.244.224',
  userUrl: 'http://en.wikipedia.org/wiki/User:108.49.244.224',
  unpatrolled: false,
  newPage: false,
  robot: false,
  anonymous: true,
  namespace: 'Article'
  flag: '',
}

Install

If you aren't on Ubuntu, try to do the equivalent to get your node.js environment set up, and run a test program:

% sudo apt-get install nodejs
% npm install wikichanges

Usage

Here's a simple example of listening on all Wikipedia channels and printing out the page that changed along with its URL.

var wikichanges = require("wikichanges");

var w = new wikichanges.WikiChanges();
w.listen(function(change) {
  console.log(change.page + " " + change.pageUrl)
});

If you would like to listen only on a particular channel or channels create the wikichanges object like this:

var w = new wikichanges.WikiChanges({wikipedias: ["#fr.wikipedia", "#de.wikipedia"]);

By default wikichanges picks a IRC nick of wikichanges-{hostname} where hostname is the hostname for the computer that your program is running. If you would like to control the IRC nick used by your program use the ircNickname option:

var w = new wikichanges.WikiChanges({ircNickname: 'super-awesome'})

License

  • CC0

wikichanges's People

Contributors

edsu avatar

Watchers

James Cloos avatar Tocho Tochev 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.