Skip to content

prabuuce/onlinextract

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

To setup onlinextract:
======================
First install MongoDB:
Import the MongoDB public GPG Key:
	$ sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10
	Create a /etc/apt/sources.list.d/mongodb.list file 
		$ echo 'deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen' | sudo tee /etc/apt/sources.list.d/mongodb.list
	 Reload repository:
	 	$ sudo apt-get update
	 Install packages
	 	$ sudo apt-get install mongodb-10gen
	 Start mongoDB service
	 	$ sudo service mongodb start (sudo service mongodb stop; sudo service mongodb restart)
	 Verify
	 	$ ps aux | grep mongo
	 Working with mongo
	 $ mongo
	 > db
	 > show dbs
	 
(0) Then, go to the desired directory where you want to install the tool (assume ~/tmp).
(1) Pull the repository from github:
	~/tmp $ git clone https://github.com/svattam/onlinextract.git
	This will get the repository which has onlinextract subdirectory:
(2) Go to onlinextract subdirectory:
	~/tmp $ cd onlinextract
(3) Create virtualenv for this project:
	~/tmp/onlinextract $ virtualenv env
(4) Activate it
	~/tmp/onlinextract $ source /env/bin/activate
	The prompt should change to:
	(env)~/tmp/onlinextract $
(5) Install requirements (dependencies) in the virtual env
	(env)~/tmp/onlinextract $ pip install -r requirements.txt
	(Note: This can take a while.)
(6) Test the setup:
	(env)~/tmp/onlinextract $ python run.py
	You should see:
	* Running on http://127.0.0.1:5000/
 	* Restarting with reloader
 	
 	Now test api:
 	$ curl http://localhost:5000
 		This should return the html document
 	$ curl http://localhost:5000/extractions
 		This should return {}, the empty dictionary
 	$ curl http://localhost:5000/extractions -d "url=http://www.bbc.com" -X POST -v
 		This should add a new extraction to the database
 	$ curl http://localhost:5000/extractions
 		This should return the extraction for http://www.bbc.com
 	
 	Now test the frontend app:
 	Open browser and enter the url http://localhost:5000
 	The rest is self explanatory
 	
 (7) Create a new Eclipse pyDev project with the root of the onlinextract application as the root of the PyDev project in Eclipse
 (8) Create a new interpreter instance and point to it from the project
 (9) Link the external libraries to the site-packages of the current interpreter in the env
 (10) When you run it, you will get an error saying "flaskext.mongoalchemy" not found. Locate the flaskext folder in 
 		site-packages and add to an empty __init__.py file to it to make the folder into a package. 
 	
 
	

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published