This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#normalize data for output | |
for entry in feed.entry: | |
#get link for template | |
entry.my_link = entry.link[0].href | |
#id for links | |
entry.my_id = curr_id | |
curr_id -= 1 | |
#format published date |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#show latest posts | |
def Posts(request): | |
return ListPosts(request, total_posts) | |
#show posts starting from a certain point | |
def ListPosts(request, start): | |
start = total_posts - int(start) + 1 | |
return PostFrom(request, start, show_num) | |
#show a single post |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<ns0:feed xmlns:ns0="http://www.w3.org/2005/Atom"> | |
<ns1:totalresults xmlns:ns1="http://a9.com/-/spec/opensearchrss/1.0/">1</ns1:totalresults> | |
<ns1:itemsperpage xmlns:ns1="http://a9.com/-/spec/opensearchrss/1.0/">0</ns1:itemsperpage> | |
<ns1:startindex xmlns:ns1="http://a9.com/-/spec/opensearchrss/1.0/">1</ns1:startindex> | |
<ns0:generator uri="http://www.blogger.com" version="7.00">Blogger</ns0:generator> | |
<ns0:author><ns0:name>Tim</ns0:name></ns0:author> | |
<ns0:id>tag:blogger.com,1999:blog-413573351281770670</ns0:id> | |
<ns0:link href="http://gpowered.blogspot.com/" rel="alternate" type="text/html" /> | |
<ns0:link href="http://gpowered.blogspot.com/feeds/posts/default" rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" /> | |
<ns0:link href="http://www.blogger.com/feeds/413573351281770670/posts/default?max-results=0" rel="self" type="application/atom+xml" /> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#get the total number of posts for this feed | |
def get_total(query): | |
#query for no posts | |
query.max_results = '0' | |
query.start_index = '1' | |
#get back entryless feed | |
feed = blogger_service.Get(query.ToUri()) | |
return int(feed.total_results.text) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
blog_id = 413573351281770670 | |
feed_url = '/feeds/%s/posts/default' % str(blog_id) | |
query = service.Query() | |
query.feed = feed_url |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def PrintUserBlogTitles(blogger_service): | |
query = service.Query() | |
query.feed = '/feeds/default/blogs' | |
feed = blogger_service.Get(query.ToUri()) | |
print feed.title.text | |
for entry in feed.entry: | |
print "\t" + entry.title.text |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#set up service | |
blogger_service = service.GDataService(user, password) | |
blogger_service.source = 'gpowered' | |
blogger_service.service = 'blogger' | |
blogger_service.server = 'www.blogger.com' | |
blogger_service.ProgrammaticLogin() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#login info | |
user = '[email protected]' | |
password = '********' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from Django.shortcuts import render_to_response | |
from gdata import service | |
import gdata | |
import atom | |
import getopt | |
import sys | |
from mx import DateTime |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function(a,b){function d(a,b){return a===null?b==="null":a===undefined?b==="undefined":a.is&&a instanceof f?b==="element":Object.prototype.toString.call(a).toLowerCase().indexOf(b)>7}function c(a){var b,e,f,g,h,i,l,m,n;if(a instanceof c)return a;d(a,"array")||(a=String(a).replace(/\s/g,"").toLowerCase().match(/(?:\+,|[^,])+/g));for(b=0,e=a.length;b<e;++b){d(a[b],"array")||(a[b]=String(a[b]).match(/(?:\+\/|[^\/])+/g)),i=[],f=a[b].length;while(f--){var l=a[b][f];h={jwertyCombo:String(l),shiftKey:!1,ctrlKey:!1,altKey:!1,metaKey:!1},d(l,"array")||(l=String(l).toLowerCase().match(/(?:(?:[^\+])+|\+\+|^\+$)/g)),g=l.length;while(g--)l[g]==="++"&&(l[g]="+"),l[g]in k.mods?h[j[k.mods[l[g]]]]=!0:l[g]in k.keys?h.keyCode=k.keys[l[g]]:m=l[g].match(/^\[([^-]+\-?[^-]*)-([^-]+\-?[^-]*)\]$/);if(d(h.keyCode,"undefined"))if(m&&m[1]in k.keys&&m[2]in k.keys){m[2]=k.keys[m[2]],m[1]=k.keys[m[1]];for(n=m[1];n<m[2];++n)i.push({altKey:h.altKey,shiftKey:h.shiftKey,metaKey:h.metaKey,ctrlKey:h.ctrlKey,keyCode:n,jwertyCombo:String(l)});h.k |