Create short url with YOURLS api and R?

915 views Asked by At

I got YOURLS to work on my computer, and I can manually create links.

Now, I would like to create a short url programmatically with YOURLS and R? I tried this

RCurl::getURL('http://yoursite/yourls-api.php?signature=1002a612b4&action="shorturl"&url="https://stackoverflow.com"')

My guess is that i'm not understanding how to use the YOURLS api

This is the error I get:

[1] "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?><result><errorCode>400</errorCode><message><![CDATA[Unknown or missing &quot;action&quot; parameter]]></message></result>"
1

There are 1 answers

0
Ignacio On BEST ANSWER

After some experimenting I got it to work!

RCurl::getURL('http://yoursite/yourls-api.php?signature=1002a612b4&format=simple&action=shorturl&url=stackoverflow.com&keyword=short1')