E-MAIL: patu24horas@live.com - (84) 98138-672
WhatsApp: (84) 98138-6727
GRUPO NO WHATSAPP: Clique aqui e entre.

segunda-feira, 16 de setembro de 2013

OBTENHA O WIDGET DO PATU 24 HORAS EM SEU SITE!



1) Faça login no Blogger, entre em “Layout” -> “Adicionar um Gadget”;
2) Escolha inserir um widget do tipo “HTML/JavaScript”, cole lá o código abaixo e salve!
CÓDIGO:

<script>
//<![CDATA[
function showrecentpostswiththumbs(json) {document.write('<ul class="recent_posts_with_thumbs">'); for (var i = 0; i < numposts; i++) {var entry = json.feed.entry[i];var posttitle = entry.title.$t;var posturl;if (i == json.feed.entry.length) break;for (var k = 0; k < entry.link.length;k++){
if(entry.link[k].rel=='replies'&&entry.link[k].type=='text/html'){var commenttext=entry.link[k].title;var commenturl=entry.link[k].href;}
if (entry.link[k].rel == 'alternate') {posturl = entry.link[k].href;break;}}var thumburl;try {thumburl=entry.media$thumbnail.url;}catch (error)

{
s=entry.content.$t;a=s.indexOf("<img");b=s.indexOf("src=\"",a);c=s.indexOf("\"",b+5);d=s.substr(b+5,c-b-5);if((a!=-1)&&(b!=-1)&&(c!=-1)&&(d!="")){
thumburl=d;} else thumburl='https://dl-web.dropbox.com/get/cb_online/sem_imagem.gif?w=cfac64d6';
}

var postdate = entry.published.$t;var cdyear = postdate.substring(0,4);var cdmonth = postdate.substring(5,7);var cdday = postdate.substring(8,10);var monthnames = new Array();monthnames[1] = "Jan";monthnames[2] = "Fev";monthnames[3] = "Mar";monthnames[4] = "Abr";monthnames[5] = "Maio";monthnames[6] = "Jun";monthnames[7] = "Jul";monthnames[8] = "Ago";monthnames[9] = "Set";monthnames[10] = "Out";monthnames[11] = "Nov";monthnames[12] = "Dez";document.write('<li class="clearfix">');


if(showpostthumbnails==true) 
document.write('<a title="'+posttitle+'" href="'+posturl+'"><img class="recent_thumb" src="'+thumburl+'"/></a>');
document.write('<h4><a title="'+posttitle+'" href="'+posturl+'">'+posttitle+'</a></h4>');

    if ("content" in entry) {
      var postcontent = entry.content.$t;}
    else
    if ("summary" in entry) {
      var postcontent = entry.summary.$t;}
    else var postcontent = "";
    var re = /<\S[^>]*>/g; 
    postcontent = postcontent.replace(re, "");


if (showpostsummary == true) {

      if (postcontent.length < numchars) {
         document.write('<p>'+postcontent+'</p>');
         }else {
         postcontent = postcontent.substring(0, numchars);
         var quoteEnd = postcontent.lastIndexOf(" ");
         postcontent = postcontent.substring(0,quoteEnd);
         document.write('<p>'+ postcontent + ' [...]</p>');}
}

var towrite='';var flag=0;
document.write('<p class="creditx">');

if(showpostdate==true) {towrite=towrite+ cdday +'/'+monthnames[parseInt(cdmonth,10)]+'/'+cdyear;flag=1;}

if(showcommentnum==true) 
{
if (flag==1) {towrite=towrite+' | ';}
if(commenttext=='0 Comments') commenttext='0 Comentários';
if(commenttext=='0 Comentários') commenttext='0 Comentários';
if(commenttext=='1 Comment') commenttext='1 Comentário';
if(commenttext=='1 Comentário') commenttext='1 Comentário';
commenttext = '<a href="'+commenturl+'" target ="_top">'+commenttext+'</a>';
towrite=towrite+commenttext;
flag=1;
;
}

if(displaymore==true) 
{
if (flag==1) towrite=towrite+' | ';
towrite=towrite+'<a href="'+posturl+'" class="url" target ="_top">Leia mais</a>';
flag=1;
;
}

document.write(towrite);

document.write('</p></li>');
if(displayseparator==true) 
if (i!=(numposts-1))
document.write('<hr/>');
}document.write('</ul>');

}
//]]>
</script>

<style type='text/css'>
img.recent_thumb {padding:2px;width:245px;height:245px;border:0;float:left;margin:0 10px 0 0; border: 1px solid #ccc;}
.recent_posts_with_thumbs {font-family: Arial, sans-serif;width: 100%;min-height: 100px;padding: 0;font-size:14px;}
ul.recent_posts_with_thumbs li {list-style: none;clear: both;padding:8px 0;}
.recent_posts_with_thumbs a {text-decoration:none; }
.recent_posts_with_thumbs strong {font-size:10px;}
.recent_posts_with_thumbs h4 {font-size: 12px;padding: 2px 0 0 0;margin:0;}
li.clearfix p{padding: 0;margin:3px 0;font-size: 11px;}
.creditx {font-size: 12px;}
</style>

<script style='text/javascript'>
var numposts = 5;
var showpostthumbnails = false;
var displaymore = true;
var displayseparator = true;
var showcommentnum = false;
var showpostdate = true;
var showpostsummary = false;
var numchars = 85;
</script>

<script src='http://patu24horas.blogspot.com.br/feeds/posts/default/?orderby=published&alt=json-in-script&callback=showrecentpostswiththumbs'></script>
←  Anterior Proxima  → Página inicial

AVISOS:

Viu algum erro ou gostaria de adicionar uma sugestão para atualizarmos alguma matéria? Mande E-mail para: patu24horas@live.com ou envie uma mensagem em nossa página no Facebook.
O PATU 24 HORAS NÃO SE RESPONSABILIZA PELO CONTEÚDO DE SITES EXTERNOS. PROIBIDO A REPRODUÇÃO DO CONTEÚDO SEM CITAR A FONTE.