Skip to content

Instantly share code, notes, and snippets.

@msukmanowsky
Created February 12, 2015 15:11
Show Gist options
  • Select an option

  • Save msukmanowsky/caf4aebc2bf502800218 to your computer and use it in GitHub Desktop.

Select an option

Save msukmanowsky/caf4aebc2bf502800218 to your computer and use it in GitHub Desktop.

Revisions

  1. msukmanowsky created this gist Feb 12, 2015.
    15 changes: 15 additions & 0 deletions parsely_api.r
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,15 @@
    install.packages("jsonlite", dependencies = TRUE)
    install.packages("RCurl", dependencies = TRUE)
    library("jsonlite")
    library("RCurl")


    base_url <- "https://api.parsely.com/v2"
    apikey <- "computerworld.com"
    api_secret <- "YOUR SECRET KEY"


    # Get top posts
    url = paste(base_url, "/analytics/posts?apikey=", apikey, "&secret=", secret, sep = "")
    top_posts <- getURL(url)
    top_posts <- jsonlite::fromJSON(top_posts)