Get random url of feeds

0

Hello it turns out that I have the doubt of how to get the url of any post published using the feeds I have the following code but it does not give the result I need.

<script type='text/javascript'>
//<![CDATA[
var post = src='/feeds/posts/default?published&amp;alt=json-in-script&amp;callback=labelthumbs&amp;max-results=3' 

var direcciones = new Array(
"post"
)

function enlaceAleatorio(){
aleat=Math.random()*direcciones.length;aleat=Math.floor(aleat);return direcciones[aleat]}
//]]></script>

<a href='enlaceAleatorio();'>Navegar</a>

I'm looking for some way to get a random link out of the feeds.

Without it being the feeds. example: http://miblogs.com/feeds/posts/default

    
asked by BotXtrem Solutions 17.08.2017 в 02:59
source

1 answer

2

The code you're trying to use is very old, and Blogger no longer supports that way of getting a JSON with your blog feed.

What is running now is the JSON API:

link

Essentially you have to generate an API key from here and then load the JSON from a URL like:

https://www.googleapis.com/blogger/v2/blogs/TU-ID-DE-BLOG?key=TU-API-KEY

Then use the same methodology of the code that you quoted in your question.

    
answered by 17.08.2017 / 04:38
source