Code Monkey home page Code Monkey logo

google-rank-tracker's Introduction

Google Keyword Ranking Check with Python

Are you poor and dont have money to buy a entepriese rank tracker? Well today is your lucky day, with this python script, a shell script and crontab you can automate Google rank checker in a few simple steps. I will explain step by step how to implement this and leave it running on a daily basis. One thing to note, currently the script does not use proxies to check for the keyword rankings, so if you are looking to run big sets of keywords google will notice this and will start showing a captcha.

Im planning on adding the use of proxies, I added a timeout in between the queries so Google wont use the captcha.

Prerequisite for this tutorial is Python 3 and terminal.

Table of Contents


Installation

Installation of Python robobrowser

pip install robobrowser

After all dependecies are installed we can start testing if the script is working fine.

Running tests

We open the terminal and go to the folder that rank.py is saved and give the script executing rights.

chmod +x rank.py

Now we are able to call our script followed by 2 arguments: the webiste we are looking for and the keyword we want to check.

python3 rank.py [website] [keyword]

For example

We want to check the website https://www.uselessthingstobuy.com/ against the keyword nothing package

python3 rank.py https://www.uselessthingstobuy.com/ nothing package

This will output The keyword, the ranking of the keyword, the URL that is ranking on Google and the date we did this rank check.

nothing+package 7 https://www.uselessthingstobuy.com/product/give-nothing-for-the-person-who-has-everything/ 16-05-2019

This will also generate a CSV file in the folder where rank.py is located. This will include all the information the terminal is showing.

Creating a shell script

Now that we tested that rank.py works fine, we will go ahead and create a shell script that will check for multiple keywords.

We create a new .sh file and add the terminal commands we run before. We add them multiple time with different keywords we want to check. We also include a time out ( sleep ) in between the command so that it looks like a normal behavior and Google dont ban you. Try to put different sleep time.

#! /bin/bash

/usr/bin/python3 /path_to_my_script/rank.py [website] [keyword1] 
sleep 30
/usr/bin/python3 /path_to_my_script/rank.py [website] [keyword2] 
sleep 20
/usr/bin/python3 /path_to_my_script/rank.py [website] [keyword3] 
sleep 30
/usr/bin/python3 /path_to_my_script/rank.py [website] [keyword4] 
sleep 25
/usr/bin/python3 /path_to_my_script/rank.py [website] [keyword5] 

After we create the shell script we would need to make the script executable

chmod +x rank.sh

and then to test the shell script. We go to the console and run it

./rank.sh

This will output 5 csv files and the output file name is composed by the date + [keyword]

Cronjob

Now that we have our .sh file running fine we will set up a cronjob that will run every day at 5:00pm

In the terminal we type

crontab -e

Then we will press the letter i to star editing and we will add the following:

0 17 * * * path_to_my_script/rank.sh

after adding this we press esc and add :wq to save.

Contributing and Questions

If you want to contribute or fix anything please feel free to do so.

If you have any question about setting this up please contact me and I will try to answer back.

google-rank-tracker's People

Contributors

sundios avatar

Watchers

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