-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from IronistM/master
Cleanup & small additions
- Loading branch information
Showing
10 changed files
with
106 additions
and
97 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
^.*\.Rproj$ | ||
^\.Rproj\.user$ | ||
^\.travis\.yml$ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# R for travis: see documentation at https://docs.travis-ci.com/user/languages/r | ||
|
||
language: R | ||
sudo: false | ||
cache: packages | ||
global: | ||
- R_CHECK_ARGS="--no-build-vignettes --no-manual --timings --no-tests" | ||
- _R_CHECK_TIMINGS_="0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,23 @@ | ||
Package: gpagespeed | ||
Title: Google Page Speed API | ||
Version: 0.0.0.9000 | ||
Authors@R: person("Simit", "Patel", email = "[email protected]", role = c("aut", "cre")) | ||
Description: A way to call the Google Page Speed Insights API directly into your | ||
R console. The package offers two functions that return results the API in the | ||
form of a data frame. The first function, speedfinder, is to call the results | ||
on a single URL, while the second function, speedlist, accepts a list of URLs | ||
and returns a single dataframe with results from the API for all the URLs in the | ||
Version: 0.0.1 | ||
Authors@R: | ||
c(person(given = "Simit", | ||
family = "Patel", | ||
role = c("aut", "cre"), | ||
email = "[email protected]"), | ||
person(given = "Manos", | ||
family = "Parzakonis", | ||
role = "ctb", | ||
email = "[email protected]")) | ||
Description: A way to call the Google Page Speed Insights API | ||
directly into your R console. The package offers two functions that | ||
return results the API in the form of a data frame. The first | ||
function, speedfinder, is to call the results on a single URL, while | ||
the second function, speedlist, accepts a list of URLs and returns a | ||
single dataframe with results from the API for all the URLs in the | ||
list. | ||
License: GPL-3 | ||
Depends: | ||
R (>= 3.2.3) | ||
Imports: | ||
|
@@ -18,7 +28,6 @@ Suggests: | |
knitr, | ||
rmarkdown, | ||
testthat | ||
License: GPL-3 | ||
LazyData: true | ||
RoxygenNote: 5.0.1 | ||
VignetteBuilder: knitr | ||
LazyData: true | ||
RoxygenNote: 6.0.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,37 @@ | ||
#gpagespeed | ||
[![Travis-CI Build Status](https://travis-ci.org/IronistM/gpagespeed.svg?branch=master)](https://travis-ci.org/IronistM/gpagespeed) | ||
|
||
# gpagespeed | ||
|
||
gpagespeed is a package designed to facilitate utilization of the Google PageSpeed Insights API. The PageSpeed Insights API provides insight into how Google's bots evaluate a given page, and the factors that web developers may wish to consider in building pages that will render faster. See Google's documentation on the PageSpeed Insights API to learn more about what the API offers as well as practical examples of its usage. | ||
|
||
The PageSpeed Insights API returns a numeric summary of the results of each page, as well as recommendations in text format. Currently, this package is designed to support only retrieving the numeric summary, which includes the overall speed score as well as metrics pertaining to the number of file requests and sizes in kilobytes of images, HTML, CSS, and JavaScript. The package offers two functions: speedfinder and speedlist. These functions are documented below. | ||
|
||
#Functions in gpagespeed | ||
|
||
<strong>1.speedfinder.</strong> The speedfinder function returns a dataframe with a single observation and columsn of numeric data as its response. It accepts three arguments: | ||
|
||
*_url_: The url argument refers to the url of the document on which the PageSpeed Insights API should be run and the corresponding summary metrics returned.<br /> | ||
*_strategy_: This argument should have one of two potential text string inputs: "desktop" or "mobile" to denote the device context that the PageSpeed Insights API should use in its evaluation.<br /> | ||
*_key_: This is the key that is required to use the API. [Visit Google's Developer Console](https://developers.google.com/console/help/using-keys) to obtain your free key. | ||
# Functions in gpagespeed | ||
|
||
<strong>2.speedlist.</strong> The speedlist function is like the speedfinder function, but allows processing of many URLs and returns a dataframe in which each observation corresponds to a unique URL. Like speedfinder, it accepts three arguments: | ||
`speedfinder` | ||
The `speedfinder` function returns a dataframe with a single observation and columns of numeric data as its response. It accepts three arguments: | ||
|
||
*_pagelist_: A list object in which each item in the list is a URL listed as a character string. <br /> | ||
*_strategy_: This argument should have one of two potential text string inputs: "desktop" or "mobile" to denote the device context that the PageSpeed Insights API should use in its evaluation.<br /> | ||
*_key_: This is the key that is required to use the API. [Visit Google's Developer Console](https://developers.google.com/console/help/using-keys) to obtain your free key. | ||
* _url_: The url argument refers to the URL of the document on which the PageSpeed Insights API should be run and the corresponding summary metrics returned. | ||
* _strategy_: This argument should have one of two potential text string inputs: "`desktop`" or "`mobile`" to denote the device context that the PageSpeed Insights API should use in its evaluation. | ||
* _key_: This is the key that is required to use the API. [Visit Google's Developer Console](https://developers.google.com/console/help/using-keys) to obtain your free key. | ||
|
||
#Example Usage | ||
`speedlist` | ||
The `speedlist` function is like the `speedfinder` function, but allows processing of many URLs and returns a dataframe in which each observation corresponds to a unique URL. Like `speedfinder`, it accepts three arguments: | ||
|
||
Below are examples of how the speedfinder and speedlist functions could be called in an R script. | ||
* _pagelist_: A list object in which each item in the list is a URL listed as a character string. | ||
* _strategy_: This argument should have one of two potential text string inputs: "`desktop`" or "`mobile`" to denote the device context that the PageSpeed Insights API should use in its evaluation. | ||
* _key_: This is the key that is required to use the API. [Visit Google's Developer Console](https://developers.google.com/console/help/using-keys) to obtain your free key. | ||
|
||
``` #get speed metrics for a single URL and assign it to a variable ``` | ||
# Example Usage | ||
|
||
``` df1 <- speedfinder("https://www.cars.com","mobile","atextkeyigotfromgoogle111") ``` | ||
Below are examples of how the `speedfinder` and `speedlist` functions could be called in an R script. | ||
|
||
``` #get speed metrics for a list of URLs and have it all returned in a single dataframe ``` | ||
``` | ||
# Get speed metrics for a single URL and assign it to a data frame | ||
df1 <- speedfinder("https://www.cars.com", "mobile", "atextkeyigotfromgoogle111") | ||
``` df2 <- speedlist(c("https://www.cars.com","http://www.yahoo.com","http://www.techmeme.com"), ``` | ||
``` "mobile","atextkeyigotfromgoogle111") ``` | ||
# Get speed metrics for a list of URLs and have it all returned in a single data frame | ||
df2 <- speedlist(c("https://www.cars.com", "http://www.yahoo.com", "http://www.techmeme.com"), | ||
"mobile", | ||
"atextkeyigotfromgoogle111") | ||
``` |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.