Changeset 3025 for trunk


Ignore:
Timestamp:
05/06/10 18:28:56 (10 years ago)
Author:
jukka
Message:

Simplified rss reading a bit, got rid of jGFeed. There is a problem with estonian blog, google cannot properly parse its rss feed, probably because of some embeds.

Location:
trunk/skins/lemill
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/skins/lemill/front-page.pt

    r3024 r3025  
    1010lang_code python:test(lang_code in ['fi','et'], lang_code,'en');   
    1111blog_url python:'http://blog.lemill.net/'+ lang_code"> 
    12 <script type="text/javascript"> 
    13 $(document).ready(function(){ 
    14 getLatestBlogPost('fi'); 
    15 }) 
    16 </script> 
    1712 
    1813<table metal:use-macro="here/main_template/macros/personal_toolbar" /> 
     
    145140</table> 
    146141 
     142<script type="text/javascript" tal:content="python:'''$(document).ready(function(){getLatestBlogPost('%s');})''' % lang_code"> 
     143</script> 
     144 
     145 
    147146</div> 
    148147</body> 
  • trunk/skins/lemill/master.js

    r3024 r3025  
    3939 
    4040 
    41  
    42 /* load blog post titles for front page, uses google api (jGFeed) as a proxy */ 
    43  
    44 /* 
    45  * jGFeed 1.0 - Google Feed API abstraction plugin for jQuery 
    46  * 
    47  * Copyright (c) 2009 jQuery HowTo 
    48  * 
    49  * Licensed under the GPL license: 
    50  *   http://www.gnu.org/licenses/gpl.html 
    51  * 
    52  * URL: 
    53  *   http://jquery-howto.blogspot.com 
    54  * 
    55  * Author URL: 
    56  *   http://me.boo.uz 
    57  * 
    58  */ 
    59 (function($){$.extend({jGFeed:function(url,fnk,num,key){if(url==null){return false;}var gurl="http://ajax.googleapis.com/ajax/services/feed/load?v=1.0&callback=?&q="+url;if(num!=null){gurl+="&num="+num;}if(key!=null){gurl+="&key="+key;}$.getJSON(gurl,function(data){if(typeof fnk=="function"){fnk.call(this,data.responseData.feed);}else{return false;}});}});})(jQuery); 
    60  
    6141function getLatestBlogPost(lang){ 
    62  $.jGFeed("http://blog.lemill.net/"+lang+"/?feed=rss2",function(data){ 
    63         item=data['entries'][0]; 
    64         pd= new Date(Date.parse(item["publishedDate"])); 
    65         html='<b><a href="'+item['link']+'">'+item['title']+'</a></b> ('+pd.getFullYear()+'-'+pd.getMonth()+'-'+pd.getDate()+')'; 
    66         $("span#title_from_blog").html(html);                
    67  },1); 
     42 url="http://blog.lemill.net/"+lang+"/?feed=rss2"; 
     43 $.getJSON("http://ajax.googleapis.com/ajax/services/feed/load?v=1.0&callback=?&q="+url,function(data){ 
     44    item=data.responseData.feed.entries[0]; 
     45    pd= new Date(Date.parse(item["publishedDate"])); 
     46    html='<b><a href="'+item['link']+'">'+item['title']+'</a></b> ('+pd.getFullYear()+'-'+pd.getMonth()+'-'+pd.getDate()+')'; 
     47    $("span#title_from_blog").html(html);                
     48 }); 
    6849} 
    6950 
Note: See TracChangeset for help on using the changeset viewer.