Django Blog Project #16: Adding URL redirects using the Blogger API
I wanted to insert URL redirects on my old Blogger posts pointing to my new blog articles. A comment on my Migrating Blogger Posts post suggested that I use the (Python) Blogger API. This was a great suggestion. The Blogger API was well documented and easy to use. Here is the script I used to insert the URL redirects on each of my old Blogger posts.
from gdata import service
import re
import gdata
import atom
NEW_HTML = """
<script language="javascript">
setTimeout('location.href="%s"', 2000);
</script>
<br /><br />
<b>
</b><p>This is my OLD blog. I've copied this ...Django Blog Project #9: Migrating Blogger posts with Beautiful Soup
Last post, I talked about adding comments to my new sample blog application. This was about the last basic feature I needed to add before I started actually using it for real. Of course there are still a number of features I'd like to add, such as automatic syntax highlighting with Pygments, and incorporating django-tagging and some more intersting views, not to mention comment moderation. But I think those will have to wait-- I want to start using my new blog for real sometime.
So for the past few days, I've been working on my Beautiful Soup screen ...
... read more »How to get syntax highlighting in Blogger with Pygments
$ sudo easy_install Pygments
$ pygmentize -f html myscript.py
- copy html code to blog post
$ pygmentize -S default -f html
- copy css to Blogger template
The Pygments website is located at: http://pygments.org
Update 5/21/2008: Andrew K. emailed me about a javascript syntax highlighter called highlight.js at http://softwaremaniacs.org/soft/highlight/en/. I have not tried it, but it looks pretty cool.
... read more »Blogger expandable post summaries
Here is the link I used to get expandable post summaries on Blogger.http://hackosphere.blogspot.com/2006/11/selective-expandable-posts.html
This hack avoids showing the "Read more..." link even if there is
nothing more to read. (The Blogger help article had this problem.)
However, this hack still has this problem if you click on the "Newer
Posts" or "Older Posts" at the bottom of the page.
Here is what's put in the post template:
Type your summary here
<span id="fullpost">
Type rest of the post here
</span>
About
I'm Eliot and this is my notepad for programming topics such as Python, Django, Ubuntu, Emacs, etc... more »
Search Blog
Tags
-
algorithms
(5)
-
aws
(9)
-
blogproject
(20)
-
c_cplusplus
(12)
-
cardstore
(8)
-
colinux
(2)
-
concurrency
(13)
-
conkeror
(2)
-
core
(2)
-
cygwin
(17)
-
datastructures
(14)
-
datetime
(4)
-
decorators
(4)
-
django
(40)
-
emacs
(22)
-
files_directories
(11)
-
git
(5)
-
hardware
(5)
-
install_setup
(8)
-
javascript
(3)
-
keyboard
(9)
-
matplotlib
(5)
-
mercurial
(4)
-
nginx
(2)
-
persistence
(5)
-
preferences
(7)
-
processes
(4)
-
pyqt
(18)
-
python
(144)
-
ratpoison
(3)
-
regexes
(6)
-
rsync
(3)
-
softwaretools
(17)
-
sql
(14)
-
ssh
(10)
-
subversion
(6)
-
twisted
(7)
-
ubuntu
(65)
-
urxvt
(5)
-
vxworks
(25)
-
webdev
(5)
-
wmii
(7)
Blogroll
- Adam Gomaa
- Alex Clemesha
- Amir Salihefendic
- Armin Ronacher
- David Beazley
- David Ziegler
- Duncan McGreggor
- Gareth Rushgrave
- Glyph Lefkowitz
- Guido van Rossum
- Ian Bicking
- Jacob Kaplan-Moss
- James Bennett
- James Tauber
- Jesper Noehr
- Marty Alchin
- Matt Harrison
- Nikolay Kolev
- Parand Darugar
- Peter Baumgartner
- Peter Bengtsson
- Rob Hudson
- Simon Willison
- Will McGugan