GithubHelp home page GithubHelp logo

normantud / wikipediakategoriengraph Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 111 KB

This allows to plot the categories of visited Wikipedia-Articles

License: GNU General Public License v2.0

Perl 61.29% PLpgSQL 38.71%

wikipediakategoriengraph's Introduction

WikiKategorienGraph

This program allows to explore the Wikipedia-categories and their relation of the articles you read with Firefox.

For example, the article "Linux" contains the category "Software" and references to Linus Torvalds, which contains the categories "Man". So "Software" connects to "Man".

This script searches for all of these categories of all the websites you visited and links them together.

Setup

Please install MySQL or PerconaDB and load the

db.sql

in it (e.g. with source db.sql).

Then install all the needed modules:

cpan -i Path::Tiny

cpan -i List::MoreUtils

cpan -i Digest::MD5

cpan -i Encode

cpan -i LWP::Simple

cpan -i Data::Dumper

cpan -i DBIx::Simple

cpan -i Term::ANSIColor

cpan -i URI::Encode

cpan -i String::ShellQuote

cpan -i DBI

Set environment variables

DBUSER=...

DBPASS=...

PLACESSQLITEPATH=~/.mozilla/firefox/RANDOMSTRING.default_RANDOMNUMBER/places.sqlite

Run it

You can then run it with

perl categories.pl $DBUSER $DBPASS $PLACESSQLITEPATH

This downloads all the websites (right now, only from the german Wikipedia, but feel free to edit it accordingly!), puts them into a cache folder and then parses them and puts their metainformation into the database.

With

perl plot.sh $DBUSER $DBPASS

You'll get a file called `autoplot.dot'. You can then use this file and plot it with GraphViz (if your graph is small), or Gephi (if your graph is huge).

You'll get a graph like this:

WikiStar

Get the most common categories

Simply use

SELECT * FROM common_categories LIMIT 10;

in the DB.

wikipediakategoriengraph's People

Contributors

normantud avatar

Watchers

James Cloos 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.