Ok, so I promised this a long time ago but I’ve hardly had the time to work on it and now it’s finally here.  A beta version of my twitter clone.

http://www.speedyshare.com/635861674.html

There is a setting you can add to your settings.py to change the number of chirps that show on a single page (default 15): NUMBER_OF_CHIRPS_PER_PAGE

Lots of things have changed! Please look through the code, I’ve commented it so it should be easy to follow (please note as of yet there is no user recognition when @someone is typed in the content of a chirp- That’ll come later)

 

It’s always good to keep web pages clean and free of clutter to focus the user experience on what really is important.  For this matter, it’s nice to be shown the difference between the time now and the time something was posted in a informal way such as below:

timetoggle-normal

So if you still wanted this uncluttered view but still desired to allow the user to see the exact moment that was, then maybe you’d have to let the user check a checkbox in their user settings are show an exact time when the view of that object is more detailed.  However I’ve come up with the idea that on mouseover the nice and informal ‘time since’ can be replaced with an exact time of the post in an easy custom filter.

Here’s the same chirp as shown above but with the mouse hovering over the time.

timetoggle-mouseover

When the mouse is rolled back out, the informal time since is displayed again.

Seamless user experience showing more detail when the user wants it :)

from django.utils import timesince, dateformat

@register.filter
def timetoggle(time, id):
link = "<span id=\""+str(id) + "timesince\"> about <a href=\"#\" onmouseover=\"document.getElementById('"+str(id)+"timeactual').style.display=''; document.getElementById('"+str(id)+"timesince').style.display='none';return false;\">"
link += timesince.timesince(time)
link += " ago</a> </span><span id=\""+str(id)+"timeactual\" style='display:none'> at <a href=\"#\" onmouseout=\"document.getElementById('"+str(id)+"timeactual').style.display='none'; document.getElementById('"+str(id)+"timesince').style.display='';return false;\">"
link += dateformat.DateFormat(time).format("g:ia o\\n l jS N Y")
link += "</a></span>"
return mark_safe(link)

Use in the following way: {{ time_object|timetoggle:unique_identifier }}   Here’s an example: {{ post.pub_date|timetoggle:post.id }}

 

In quick succession to my earlier blog post about Hit Counters Don’t Need To Be Boring, I’m writing another post about how that same algorithm can be used to measure voting on stories or popular items as well.

This thought process all started when browsing through reddit earlier today and noticed a post that described a voting algorithm that allowed for old very popular stories to come below newer less popular stories due to a decay.  The huge problem with this algorithm though was that the date the story was created influenced how far down in the list it would go. Continue reading »

 

One design aspect I have with athe.la is to provide a ranking of albums and artists given the number of hits the pages have had.  This got me thinking of all the different ways that hit counters could work.

There are 3 sections to this post:

1) Counting Visits – how visits to the page can be counted from unique and non-unique visitors
2) Current Hit Counters – what kind of hit counters are in use today and what are their downsides
3) Buzz Hit Counter – why my new method for counting hits has all the upsides of current hit counters and has no downsides! Continue reading »

© 2011 athe.la blog Suffusion theme by Sayontan Sinha