Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*
- * Copyright (c) 2012 [iPs]TeaM
- * Bruno da Silva (email@brunodasilva.com)
- * Pegar links e títulos de post aleatoriamente em blogspot
- *
- * www.brunodasilva.com
- * www.ips-team.forumeiros.com
- */
- $url = $_GET['url'];
- $url .= "/feeds/posts/default";
- $xml = simplexml_load_file($url);
- $total =(int) $xml->children('openSearch', true)->totalResults;
- $aleatorio = mt_rand ( 25, $total );
- pegarLigações( ($aleatorio - 25), $aleatorio ) ;
- function pegarLigações( $inicio, $fim )
- {
- $url = $_GET['url'];
- $url .= "/feeds/posts/default";
- $url .= "?start-index=$inicio&max-results=$fim";
- $xml = simplexml_load_file($url);
- for ($i = 0; isset( $xml->entry[$i]->title) ; $i ++) {
- echo $xml->entry[$i]->title;
- echo $xml->entry[$i]->link[4]["href"] . "<br/>";
- }
- return true;
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement