Hello!
It is necessary to obtain the URL of the address to all posts of the Reddit site, according to the search query. For this, I use the reddit_urls () function from the R-package "RedditExtratoR".
My problem. Some links contain characters in Spanish (for example, 'ó'), which the R-function returns to me in a specific encoding with a backslash ('\').
For example. Browser link: https://www.reddit.com/r/Barca/comments/4g4fmp/match_thread_fc_barcelona_vs_sporting_de_gijón/
The link that the reddit_urls () function returns to me is: " http://www.reddit.com/r/Barca/comments/4g4fmp/match_thread_fc_barcelona_vs_sporting_de_gij \ 363n /"
As a result, R is unable to work with the following address:
> reddit_content('http://www.reddit.com/r/Barca/comments/4g4fmp/match_thread_fc_barcelona_vs_sporting_de_gij\363n/') Warning messages: 1: In grepl("^https?://(.*)", URL[i]) : input string 1 is invalid in this locale 2: In file(con, "r") : cannot open URL 'https://www.reddit.com/r/Barca/comments/4g4fmp/match_thread_fc_barcelona_vs_sporting_de_gij n/.json?limit=500': HTTP status was '503 Service Unavailable' 3: In file(con, "r") : cannot open URL 'https://www.reddit.com/r/Barca/comments/4g4fmp/match_thread_fc_barcelona_vs_sporting_de_gij n/.json?limit=500': HTTP status was '503 Service Unavailable' I need to re-encode part of the URL with a slash "\ 363n" on a character that will restore the link to be processed for further processing in R.