Home

New Server @ March 12, 2011, 12:53 p.m.
Filed under: Personal  Tech  Scroll 
If you are seeing this the blog has moved to a new server. Things will probably break a bit for a while and the blog ping services may see pings for old posts (sorry!).
 digg it   seed it   del.icio.us   ma.gnolia
Comments: 0 Tags:      


Recent Scroll Updates @ Feb. 22, 2009, 8:22 p.m.
Filed under: Django  Code  Tech  Scroll  Python 
My dog killed my old laptop by jumping on it so I decided to do some work on scroll (don't question it). Here are some updates to the code base currently in git:

templates reside in app directories
supports more ping services: Technorati, Google, Weblogs, Syndicate, Feedburner and Icerocket


 digg it   seed it   del.icio.us   ma.gnolia
Comments: 0 Tags:          


Scroll On Ohloh And More @ Dec. 24, 2008, 12:25 p.m.
Filed under: Django  Code  Tech  Scroll  Python 
It's finally there .... I'm just lazy sometimes :-).

Some other things in the pipeline for the next release are:

* added multiple pinging services and moved receiver code into a nicer form
* added google and technorati ping signal catchers
* added gravatar support
* super basic comment support

 digg it   seed it   del.icio.us   ma.gnolia
Comments: 0 Tags:          


Full Featured Django Gravatar Tag @ Dec. 14, 2008, 12:21 a.m.
Filed under: Django  Code  Tech  Scroll  Python 
After looking at the simple implementations others had done, and always disliking when something is only half implemented, I threw together a Django tag that creates full Gravatar url's.

from hashlib import md5

from django import template


# We call it avatar_url instead of gravatar_url so if we change services in the
# future it's just a change of the tag.
@register.simple_tag
def avatar_url(email, size=50, rating='g', default=None):
    """
    Returns a gravatar url.

    Example tag usage: {% avatar user.email 80 "g" %}

    :Parameters:
       - `email`: the email to send to gravatar.
       - `size`: optional YxY size for the image.
       - `rating`: optional rating (g, pg, r, or x) of the image.
       - `default`: optional default image url or hosted image like wavatar.
    """
    # Verify the rating actually is a rating accepted by gravatar
    rating = rating.lower()
    ratings = ['g', 'pg', 'r', 'x']
    if rating not in ratings:
        raise template.TemplateSyntaxError('rating must be %s' % (
            ", ".join(ratings)))
    # Create and return the url
    hash = md5(email).hexdigest()
    url = 'http://www.gravatar.com/avatar/%s?s=%s&r=%s' % (
        hash, size, rating)
    if default:
        url = "%s&d=%s" % (url, default)
    return url


Also see: Django Snippets Post

 digg it   seed it   del.icio.us   ma.gnolia
Comments: 0 Tags:          


Upgraded Blog Software @ Sept. 28, 2008, 5:24 p.m.
Filed under: Tech  Scroll  Python 
I'm now running the latest development HEAD of scroll. If you see any issues please let me know. You may notice code now goes to a development section with listings of stuff I work on instead of just throwing you into a bunch of code repositories.
 digg it   seed it   del.icio.us   ma.gnolia
Comments: 0 Tags:      


 
A Django joint.
© 2007-2009 Steve 'Ashcrow' Milner | Studio7designs | Arbutus Photography