roas is a convience wrapper around with Open Ad Stream (OAS) API
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 | ## Not run:
options(stringsAsFactors = FALSE)
library(XML)
library(roas)
# create your credentials
my_credentials <- oas_build_credentials(account=myaccount,
username=myusername,
password=mypassword)
# get a list of sites from your OAS account
my_list_of_sites <- oas_list(credentials=my_credentials, request_type='Site')
# restrict lists with search criteria
list_by_criteria <- oas_list(credentials=my_credentials, request_type='Page',
search_criteria_attributes = c(pageSize=100),
search_criteria=list(newXMLNode("Domain", "mySite"),
newXMLNode("Url", "001"),
newXMLNode("SectionId", "Ar%ves"),
newXMLNode("SiteId", "ApiSite"),
newXMLNode("Description", "My Page"),
newXMLNode("LocationKey", "7"),
newXMLNode("WhenCreated",
attrs = c(condition = "GT"),
'2014-12-31'),
newXMLNode("WhenModified",
attrs = c(condition = "GT"),
'2013-12-31'))))
# retrieve geographic codes
country_criteria_node = newXMLNode("Country")
country_code_node = newXMLNode("Code", "US", parent = country_criteria_node)
list_city_codes_by_country <- oas_list_code(credentials=my_credentials, code_type='City',
search_criteria_attributes = c(pageSize="1000"),
search_criteria=list(country_code_node))
)
# run a precanned report
site_delivery_info <- oas_report(credentials = my_credentials,
report_type = 'Site Delivery',
report_name = 'Executive Summary',
id = 'www.mysite.com')
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.