From 9d562e13961fa09ee6bcb01ad1bff8d809a1d920 Mon Sep 17 00:00:00 2001 From: christopherkenny Date: Fri, 6 Dec 2024 16:09:02 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20@=20christop?= =?UTF-8?q?herkenny/opengraph@e46e1a2db62a21dc39e2d0666fec02f5a3efdf7c=20?= =?UTF-8?q?=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.html | 20 +++++++++++++++++--- pkgdown.yml | 2 +- search.json | 2 +- 3 files changed, 19 insertions(+), 5 deletions(-) diff --git a/index.html b/index.html index 26fd9a5..5aefdd1 100644 --- a/index.html +++ b/index.html @@ -64,12 +64,26 @@

Installation

Example

-

This is a basic example which shows you how to solve a common problem:

+

This is a relatively simple package. The main function is og_parse() which returns a named vector of Open Graph metadata found on a given webpage.

 library(opengraph)
-## basic example code
-url <- "https://www.r-project.org/"
+url <- 'https://christophertkenny.com/opengraph/'
 og_parse(url)
+#>                                                           title 
+#>                               "Process the Open Graph Protocol" 
+#>                                                     description 
+#> "Parse metadata on websites which use the Open Graph Protocol." 
+#>                                                           image 
+#>               "http://christophertkenny.com/opengraph/logo.png"
+

The package can also read specific Open Graph properties with og_property(). Properties can be prefixed with og: or not.

+
+og_property(url, 'og:title')
+#> [1] "Process the Open Graph Protocol"
+og_property(url, 'title')
+#> [1] "Process the Open Graph Protocol"
+

If there is no Open Graph metadata found, og_parse() will return an empty named vector.

+
+og_parse('https://cran.r-project.org/')
 #> named character(0)
diff --git a/pkgdown.yml b/pkgdown.yml index a6b851d..5eca691 100644 --- a/pkgdown.yml +++ b/pkgdown.yml @@ -2,7 +2,7 @@ pandoc: 3.1.11 pkgdown: 2.1.1 pkgdown_sha: ~ articles: {} -last_built: 2024-12-06T16:00Z +last_built: 2024-12-06T16:08Z urls: reference: http://christophertkenny.com/opengraph/reference article: http://christophertkenny.com/opengraph/articles diff --git a/search.json b/search.json index 3253679..845fe3d 100644 --- a/search.json +++ b/search.json @@ -1 +1 @@ -[{"path":"http://christophertkenny.com/opengraph/LICENSE.html","id":null,"dir":"","previous_headings":"","what":"MIT License","title":"MIT License","text":"Copyright (c) 2024 opengraph authors Permission hereby granted, free charge, person obtaining copy software associated documentation files (“Software”), deal Software without restriction, including without limitation rights use, copy, modify, merge, publish, distribute, sublicense, /sell copies Software, permit persons Software furnished , subject following conditions: copyright notice permission notice shall included copies substantial portions Software. SOFTWARE PROVIDED “”, WITHOUT WARRANTY KIND, EXPRESS IMPLIED, INCLUDING LIMITED WARRANTIES MERCHANTABILITY, FITNESS PARTICULAR PURPOSE NONINFRINGEMENT. EVENT SHALL AUTHORS COPYRIGHT HOLDERS LIABLE CLAIM, DAMAGES LIABILITY, WHETHER ACTION CONTRACT, TORT OTHERWISE, ARISING , CONNECTION SOFTWARE USE DEALINGS SOFTWARE.","code":""},{"path":"http://christophertkenny.com/opengraph/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Christopher T. Kenny. Author, maintainer.","code":""},{"path":"http://christophertkenny.com/opengraph/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Kenny C (2024). opengraph: Process Open Graph Protocol. R package version 0.0.0.9000, http://christophertkenny.com/opengraph/.","code":"@Manual{, title = {opengraph: Process the Open Graph Protocol}, author = {Christopher T. Kenny}, year = {2024}, note = {R package version 0.0.0.9000}, url = {http://christophertkenny.com/opengraph/}, }"},{"path":"http://christophertkenny.com/opengraph/index.html","id":"opengraph-","dir":"","previous_headings":"","what":"Process the Open Graph Protocol","title":"Process the Open Graph Protocol","text":"goal opengraph read process Open Graph Protocol HTML websites.","code":""},{"path":"http://christophertkenny.com/opengraph/index.html","id":"installation","dir":"","previous_headings":"","what":"Installation","title":"Process the Open Graph Protocol","text":"can install development version opengraph GitHub :","code":"# install.packages('pak') pak::pak('christopherkenny/opengraph')"},{"path":"http://christophertkenny.com/opengraph/index.html","id":"example","dir":"","previous_headings":"","what":"Example","title":"Process the Open Graph Protocol","text":"basic example shows solve common problem:","code":"library(opengraph) ## basic example code url <- \"https://www.r-project.org/\" og_parse(url) #> named character(0)"},{"path":"http://christophertkenny.com/opengraph/reference/og_parse.html","id":null,"dir":"Reference","previous_headings":"","what":"Parse Open Graph Metadata — og_parse","title":"Parse Open Graph Metadata — og_parse","text":"Parse Open Graph Metadata","code":""},{"path":"http://christophertkenny.com/opengraph/reference/og_parse.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Parse Open Graph Metadata — og_parse","text":"","code":"og_parse(url)"},{"path":"http://christophertkenny.com/opengraph/reference/og_parse.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Parse Open Graph Metadata — og_parse","text":"url string representing URL webpage parse.","code":""},{"path":"http://christophertkenny.com/opengraph/reference/og_parse.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Parse Open Graph Metadata — og_parse","text":"named list Open Graph metadata.","code":""},{"path":"http://christophertkenny.com/opengraph/reference/og_parse.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Parse Open Graph Metadata — og_parse","text":"","code":"og_parse('https://www.rstudio.com') #> image #> \"https://posit.co/wp-content/themes/Posit/dist/images/site-share-image.jpg\" #> image:type #> \"image/jpg\" #> image:width #> \"1200\" #> image:height #> \"630\" #> url #> \"https://www.posit.co/\" #> title #> \"Posit\" #> locale #> \"en_US\" #> type #> \"website\" #> title #> \"Posit | The Open-Source Data Science Company\" #> description #> \"The best data science is open source. Posit is committed to creating incredible open-source tools for individuals, teams, and enterprises.\" #> url #> \"https://posit.co/\" #> site_name #> \"Posit\""},{"path":"http://christophertkenny.com/opengraph/reference/og_property.html","id":null,"dir":"Reference","previous_headings":"","what":"Extract a specific Open Graph property from a webpage. — og_property","title":"Extract a specific Open Graph property from a webpage. — og_property","text":"Extract specific Open Graph property webpage.","code":""},{"path":"http://christophertkenny.com/opengraph/reference/og_property.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Extract a specific Open Graph property from a webpage. — og_property","text":"","code":"og_property(url, property)"},{"path":"http://christophertkenny.com/opengraph/reference/og_property.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Extract a specific Open Graph property from a webpage. — og_property","text":"url string representing URL webpage parse. property string indicating Open Graph property (e.g., \"og:title\" \"title\").","code":""},{"path":"http://christophertkenny.com/opengraph/reference/og_property.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Extract a specific Open Graph property from a webpage. — og_property","text":"string containing value specified property, NA found.","code":""},{"path":"http://christophertkenny.com/opengraph/reference/og_property.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Extract a specific Open Graph property from a webpage. — og_property","text":"","code":"og_property('https://www.rstudio.com', 'og:title') #> [1] \"Posit\""},{"path":"http://christophertkenny.com/opengraph/reference/og_schema.html","id":null,"dir":"Reference","previous_headings":"","what":"Open Graph Schema — og_schema","title":"Open Graph Schema — og_schema","text":"2024-12-05. Based https://ogp./","code":""},{"path":"http://christophertkenny.com/opengraph/reference/og_schema.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Open Graph Schema — og_schema","text":"","code":"og_schema()"},{"path":"http://christophertkenny.com/opengraph/reference/og_schema.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Open Graph Schema — og_schema","text":"character vector Open Graph schema.","code":""},{"path":"http://christophertkenny.com/opengraph/reference/og_schema.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Open Graph Schema — og_schema","text":"","code":"og_schema() #> [1] \"og:title\" \"og:type\" #> [3] \"og:image\" \"og:url\" #> [5] \"og:audio\" \"og:description\" #> [7] \"og:determiner\" \"og:locale\" #> [9] \"og:locale:alternate\" \"og:site_name\" #> [11] \"og:video\" \"og:image:url\" #> [13] \"og:image:secure_url\" \"og:image:type\" #> [15] \"og:image:width\" \"og:image:height\" #> [17] \"og:image:alt\" \"og:video:url\" #> [19] \"og:video:secure_url\" \"og:video:type\" #> [21] \"og:video:width\" \"og:video:height\" #> [23] \"og:video:alt\" \"og:audio:url\" #> [25] \"og:audio:secure_url\" \"og:audio:type\" #> [27] \"music:duration\" \"music:album\" #> [29] \"music:album:disc\" \"music:album:track\" #> [31] \"music:musician\" \"music.album\" #> [33] \"music:song\" \"music:song:disc\" #> [35] \"music:song:track\" \"music:musician\" #> [37] \"music:release_date\" \"music.playlist\" #> [39] \"music:song\" \"music:song:disc\" #> [41] \"music:song:track\" \"music:creator\" #> [43] \"music.radio_station\" \"music:creator\" #> [45] \"video.movie\" \"video:actor\" #> [47] \"video:actor:role\" \"video:director\" #> [49] \"video:writer\" \"video:duration\" #> [51] \"video:release_date\" \"video:tag\" #> [53] \"video.episode\" \"video:actor\" #> [55] \"video:actor:role\" \"video:director\" #> [57] \"video:writer\" \"video:duration\" #> [59] \"video:release_date\" \"video:tag\" #> [61] \"video:series\" \"video.tv_show\" #> [63] \"video.other\" \"article\" #> [65] \"article:published_time\" \"article:modified_time\" #> [67] \"article:expiration_time\" \"article:author\" #> [69] \"article:section\" \"article:tag\" #> [71] \"book\" \"book:author\" #> [73] \"book:isbn\" \"book:release_date\" #> [75] \"book:tag\" \"profile\" #> [77] \"profile:first_name\" \"profile:last_name\" #> [79] \"profile:username\" \"profile:gender\" #> [81] \"website\""},{"path":"http://christophertkenny.com/opengraph/reference/og_validate.html","id":null,"dir":"Reference","previous_headings":"","what":"Validate Open Graph Metadata — og_validate","title":"Validate Open Graph Metadata — og_validate","text":"Check required Open Graph properties present.","code":""},{"path":"http://christophertkenny.com/opengraph/reference/og_validate.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Validate Open Graph Metadata — og_validate","text":"","code":"og_validate(metadata)"},{"path":"http://christophertkenny.com/opengraph/reference/og_validate.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Validate Open Graph Metadata — og_validate","text":"metadata named list Open Graph metadata.","code":""},{"path":"http://christophertkenny.com/opengraph/reference/og_validate.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Validate Open Graph Metadata — og_validate","text":"logical value indicating whether required metadata present.","code":""},{"path":"http://christophertkenny.com/opengraph/reference/og_validate.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Validate Open Graph Metadata — og_validate","text":"","code":"og_parse('https://www.rstudio.com') |> og_validate() #> [1] TRUE"}] +[{"path":"http://christophertkenny.com/opengraph/LICENSE.html","id":null,"dir":"","previous_headings":"","what":"MIT License","title":"MIT License","text":"Copyright (c) 2024 opengraph authors Permission hereby granted, free charge, person obtaining copy software associated documentation files (“Software”), deal Software without restriction, including without limitation rights use, copy, modify, merge, publish, distribute, sublicense, /sell copies Software, permit persons Software furnished , subject following conditions: copyright notice permission notice shall included copies substantial portions Software. SOFTWARE PROVIDED “”, WITHOUT WARRANTY KIND, EXPRESS IMPLIED, INCLUDING LIMITED WARRANTIES MERCHANTABILITY, FITNESS PARTICULAR PURPOSE NONINFRINGEMENT. EVENT SHALL AUTHORS COPYRIGHT HOLDERS LIABLE CLAIM, DAMAGES LIABILITY, WHETHER ACTION CONTRACT, TORT OTHERWISE, ARISING , CONNECTION SOFTWARE USE DEALINGS SOFTWARE.","code":""},{"path":"http://christophertkenny.com/opengraph/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Christopher T. Kenny. Author, maintainer.","code":""},{"path":"http://christophertkenny.com/opengraph/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Kenny C (2024). opengraph: Process Open Graph Protocol. R package version 0.0.0.9000, http://christophertkenny.com/opengraph/.","code":"@Manual{, title = {opengraph: Process the Open Graph Protocol}, author = {Christopher T. Kenny}, year = {2024}, note = {R package version 0.0.0.9000}, url = {http://christophertkenny.com/opengraph/}, }"},{"path":"http://christophertkenny.com/opengraph/index.html","id":"opengraph-","dir":"","previous_headings":"","what":"Process the Open Graph Protocol","title":"Process the Open Graph Protocol","text":"goal opengraph read process Open Graph Protocol HTML websites.","code":""},{"path":"http://christophertkenny.com/opengraph/index.html","id":"installation","dir":"","previous_headings":"","what":"Installation","title":"Process the Open Graph Protocol","text":"can install development version opengraph GitHub :","code":"# install.packages('pak') pak::pak('christopherkenny/opengraph')"},{"path":"http://christophertkenny.com/opengraph/index.html","id":"example","dir":"","previous_headings":"","what":"Example","title":"Process the Open Graph Protocol","text":"relatively simple package. main function og_parse() returns named vector Open Graph metadata found given webpage. package can also read specific Open Graph properties og_property(). Properties can prefixed og: . Open Graph metadata found, og_parse() return empty named vector.","code":"library(opengraph) url <- 'https://christophertkenny.com/opengraph/' og_parse(url) #> title #> \"Process the Open Graph Protocol\" #> description #> \"Parse metadata on websites which use the Open Graph Protocol.\" #> image #> \"http://christophertkenny.com/opengraph/logo.png\" og_property(url, 'og:title') #> [1] \"Process the Open Graph Protocol\" og_property(url, 'title') #> [1] \"Process the Open Graph Protocol\" og_parse('https://cran.r-project.org/') #> named character(0)"},{"path":"http://christophertkenny.com/opengraph/reference/og_parse.html","id":null,"dir":"Reference","previous_headings":"","what":"Parse Open Graph Metadata — og_parse","title":"Parse Open Graph Metadata — og_parse","text":"Parse Open Graph Metadata","code":""},{"path":"http://christophertkenny.com/opengraph/reference/og_parse.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Parse Open Graph Metadata — og_parse","text":"","code":"og_parse(url)"},{"path":"http://christophertkenny.com/opengraph/reference/og_parse.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Parse Open Graph Metadata — og_parse","text":"url string representing URL webpage parse.","code":""},{"path":"http://christophertkenny.com/opengraph/reference/og_parse.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Parse Open Graph Metadata — og_parse","text":"named list Open Graph metadata.","code":""},{"path":"http://christophertkenny.com/opengraph/reference/og_parse.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Parse Open Graph Metadata — og_parse","text":"","code":"og_parse('https://www.rstudio.com') #> image #> \"https://posit.co/wp-content/themes/Posit/dist/images/site-share-image.jpg\" #> image:type #> \"image/jpg\" #> image:width #> \"1200\" #> image:height #> \"630\" #> url #> \"https://www.posit.co/\" #> title #> \"Posit\" #> locale #> \"en_US\" #> type #> \"website\" #> title #> \"Posit | The Open-Source Data Science Company\" #> description #> \"The best data science is open source. Posit is committed to creating incredible open-source tools for individuals, teams, and enterprises.\" #> url #> \"https://posit.co/\" #> site_name #> \"Posit\""},{"path":"http://christophertkenny.com/opengraph/reference/og_property.html","id":null,"dir":"Reference","previous_headings":"","what":"Extract a specific Open Graph property from a webpage. — og_property","title":"Extract a specific Open Graph property from a webpage. — og_property","text":"Extract specific Open Graph property webpage.","code":""},{"path":"http://christophertkenny.com/opengraph/reference/og_property.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Extract a specific Open Graph property from a webpage. — og_property","text":"","code":"og_property(url, property)"},{"path":"http://christophertkenny.com/opengraph/reference/og_property.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Extract a specific Open Graph property from a webpage. — og_property","text":"url string representing URL webpage parse. property string indicating Open Graph property (e.g., \"og:title\" \"title\").","code":""},{"path":"http://christophertkenny.com/opengraph/reference/og_property.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Extract a specific Open Graph property from a webpage. — og_property","text":"string containing value specified property, NA found.","code":""},{"path":"http://christophertkenny.com/opengraph/reference/og_property.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Extract a specific Open Graph property from a webpage. — og_property","text":"","code":"og_property('https://www.rstudio.com', 'og:title') #> [1] \"Posit\""},{"path":"http://christophertkenny.com/opengraph/reference/og_schema.html","id":null,"dir":"Reference","previous_headings":"","what":"Open Graph Schema — og_schema","title":"Open Graph Schema — og_schema","text":"2024-12-05. Based https://ogp./","code":""},{"path":"http://christophertkenny.com/opengraph/reference/og_schema.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Open Graph Schema — og_schema","text":"","code":"og_schema()"},{"path":"http://christophertkenny.com/opengraph/reference/og_schema.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Open Graph Schema — og_schema","text":"character vector Open Graph schema.","code":""},{"path":"http://christophertkenny.com/opengraph/reference/og_schema.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Open Graph Schema — og_schema","text":"","code":"og_schema() #> [1] \"og:title\" \"og:type\" #> [3] \"og:image\" \"og:url\" #> [5] \"og:audio\" \"og:description\" #> [7] \"og:determiner\" \"og:locale\" #> [9] \"og:locale:alternate\" \"og:site_name\" #> [11] \"og:video\" \"og:image:url\" #> [13] \"og:image:secure_url\" \"og:image:type\" #> [15] \"og:image:width\" \"og:image:height\" #> [17] \"og:image:alt\" \"og:video:url\" #> [19] \"og:video:secure_url\" \"og:video:type\" #> [21] \"og:video:width\" \"og:video:height\" #> [23] \"og:video:alt\" \"og:audio:url\" #> [25] \"og:audio:secure_url\" \"og:audio:type\" #> [27] \"music:duration\" \"music:album\" #> [29] \"music:album:disc\" \"music:album:track\" #> [31] \"music:musician\" \"music.album\" #> [33] \"music:song\" \"music:song:disc\" #> [35] \"music:song:track\" \"music:musician\" #> [37] \"music:release_date\" \"music.playlist\" #> [39] \"music:song\" \"music:song:disc\" #> [41] \"music:song:track\" \"music:creator\" #> [43] \"music.radio_station\" \"music:creator\" #> [45] \"video.movie\" \"video:actor\" #> [47] \"video:actor:role\" \"video:director\" #> [49] \"video:writer\" \"video:duration\" #> [51] \"video:release_date\" \"video:tag\" #> [53] \"video.episode\" \"video:actor\" #> [55] \"video:actor:role\" \"video:director\" #> [57] \"video:writer\" \"video:duration\" #> [59] \"video:release_date\" \"video:tag\" #> [61] \"video:series\" \"video.tv_show\" #> [63] \"video.other\" \"article\" #> [65] \"article:published_time\" \"article:modified_time\" #> [67] \"article:expiration_time\" \"article:author\" #> [69] \"article:section\" \"article:tag\" #> [71] \"book\" \"book:author\" #> [73] \"book:isbn\" \"book:release_date\" #> [75] \"book:tag\" \"profile\" #> [77] \"profile:first_name\" \"profile:last_name\" #> [79] \"profile:username\" \"profile:gender\" #> [81] \"website\""},{"path":"http://christophertkenny.com/opengraph/reference/og_validate.html","id":null,"dir":"Reference","previous_headings":"","what":"Validate Open Graph Metadata — og_validate","title":"Validate Open Graph Metadata — og_validate","text":"Check required Open Graph properties present.","code":""},{"path":"http://christophertkenny.com/opengraph/reference/og_validate.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Validate Open Graph Metadata — og_validate","text":"","code":"og_validate(metadata)"},{"path":"http://christophertkenny.com/opengraph/reference/og_validate.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Validate Open Graph Metadata — og_validate","text":"metadata named list Open Graph metadata.","code":""},{"path":"http://christophertkenny.com/opengraph/reference/og_validate.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Validate Open Graph Metadata — og_validate","text":"logical value indicating whether required metadata present.","code":""},{"path":"http://christophertkenny.com/opengraph/reference/og_validate.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Validate Open Graph Metadata — og_validate","text":"","code":"og_parse('https://www.rstudio.com') |> og_validate() #> [1] TRUE"}]