Skip to content

Instantly share code, notes, and snippets.

@wookiecooking
Last active August 29, 2015 13:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wookiecooking/10083964 to your computer and use it in GitHub Desktop.
Save wookiecooking/10083964 to your computer and use it in GitHub Desktop.
[coffeescript] Simple Google SERP Tracking
# GTrack: Simple Google SERP Tracking
# Notes: A simple app that tracks the position of a URL in google SERPs. No promises.
# LICENSE: MIT
# Author: Austin Turnage
gtrack = (url, keyword, results) ->
scraper = require("google-scraper")
scrape = new scraper.GoogleScraper(
keyword: keyword
language: "en"
results: results
)
scrape.getGoogleLinks (arrayLink) ->
i = 0
while i < arrayLink.length
console.log url + " postion is " + i if arrayLink[i] is url
i += 1
# Example Usage
gtrack "http://en.wikipedia.org/wiki/JavaScript", "javascript", 500
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment