Git Product home page Git Product logo

webclinic017 / page-rank-algorithm Goto Github PK

View Code? Open in Web Editor NEW

This project forked from tejaslinge/page-rank-algorithm

0.0 0.0 0.0 1.11 MB

Simple Python Search Spider, Page Ranker, and Visualizer. This is a set of programs that emulate some of the functions of a search engine. They store their data in a SQLITE3 database named 'spider.sqlite'. This file can be removed at any time to restart the process.

JavaScript 45.30% Python 51.40% HTML 3.30%

page-rank-algorithm's Introduction

Simple Python Search Spider, Page Ranker, and Visualizer

This is a set of programs that emulate some of the functions of a 
search engine.  They store their data in a SQLITE3 database named
'spider.sqlite'.  This file can be removed at any time to restart the
process.   

This program(spider_webpages.py) crawls a web site and pulls a series of pages into the
database, recording the links between pages.

Enter web url or enter: ['http://www.google.com']
How many pages:2
143 https://www.google.com/drive/download (40210) 15
41 https://www.google.com/about/philosophy.html (31145) 15
How many pages:

In this sample run, we told it to crawl a website and retrieve two 
pages.  If you restart the program again and tell it to crawl more
pages, it will not re-crawl any pages already in the database.  Upon 
restart it goes to a random non-crawled page and starts there.  So 
each successive run of spider_webpages.py is additive.

You can have multiple starting points in the same database - 
within the program these are called "webs". The spider
chooses randomly amongst all non-visited links across all
the webs.

If you want to dump the contents of the spider.sqlite file, you can 
run spider_dump.py.

Once you have a few pages in the database, you can run Page Rank on the
pages using the spider_rank.py program.  You simply tell it how many Page
Rank iterations to run.

You can dump the database again to see that page rank has been updated.

You can run spider_rank.py as many times as you like and it will simply refine
the page rank the more times you run it. 

If you want to visualize the current top pages in terms of page rank,
run spider_json.py to write the pages out in JSON format to be viewed in a
web browser.

You can view this data by opening the file force.html in your web browser.  
This shows an automatic layout of the nodes and links.  You can click and 
drag any node and you can also double click on a node to find the URL
that is represented by the node.

page-rank-algorithm's People

Contributors

tejaslinge 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.