<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xml:base="http://whijo.net" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
 <title>internet</title>
 <link>http://whijo.net/taxonomy/term/34/feed</link>
 <description>The taxonomy view with a depth of 0.</description>
 <language>en</language>
<item>
 <title>2Boyz</title>
 <link>http://whijo.net/services/services/2boyz</link>
 <description>&lt;p&gt;This is just a page to make a point about optimising for web traffic, and showing how easy it is to get onto google rankings for things like 2Boyz.&lt;/p&gt;
&lt;p&gt;2Boyz are a small company based in East London that specialise in advertising, graphic design, brand management, e-design, video production, promotional design.&lt;/p&gt;
&lt;p&gt;They are a cool, and growing company, so keep on the lookout for them!&lt;/p&gt;
</description>
 <category domain="http://whijo.net/tags/2boyz">2boyz</category>
 <category domain="http://whijo.net/tags/advertising">advertising</category>
 <category domain="http://whijo.net/tags/brand-management">brand management</category>
 <category domain="http://whijo.net/tags/design">design</category>
 <category domain="http://whijo.net/tags/internet">internet</category>
 <category domain="http://whijo.net/tags/marketing">marketing</category>
 <pubDate>Mon, 08 Oct 2007 22:18:32 +0200</pubDate>
 <dc:creator>brad</dc:creator>
 <guid isPermaLink="false">404 at http://whijo.net</guid>
</item>
<item>
 <title>South African web development companies</title>
 <link>http://whijo.net/blog/brad/2007/08/29/south-african-web-development-companies.html</link>
 <description>&lt;p&gt;&lt;a href=&quot;http://vincentmaher.com&quot;&gt;Vincent Maher&lt;/a&gt; wrote quite a nice post about &lt;a href=&quot;http://www.thoughtleader.co.za/vincentmaher/2007/08/29/are-web-development-companies-still-the-best-place-for-web-advice/&quot;&gt;Are web development companies still the best place for web advice?&lt;/a&gt;. He speaks about how the South African web development/design companies are a bit off the mark (in general) about how websites should work, and how users should interact with the site. Once when chatting to a local company they spoke about how “We need to own the customer and to do that we need to block off all points of exit from this website.” I think they push heavy crack, and I don&#039;t think they ever actually learnt about the web, they figured it was an interesting way to put billboards up for higher margins. &lt;/p&gt;
&lt;p&gt;I suppose it is the same attitude that sees us embroiled in yet another &lt;a href=&quot;http://en.wikipedia.org/wiki/Format_wars&quot;&gt;format war&lt;/a&gt;, the same market practices that exclude rather than include. These are the same people who don&#039;t understand why Amazon, et al work as well as they do, they don&#039;t understand that the web is about the people. It all comes back to jealousy and greed really...the jealous and greedy person tries to control the situation so they can milk it for everything, the pragmatic person works with the situation, moves and flows, and benefits the most in the end. This attitude of greed and control kind of works in the real world (but ultimately the greedy are brought to their knees), but on the internet the best players are the ones who fit into the neighbourhood, the ones who let you put your lemonade store on their front lawn because they know you will tell your friends to come buy lemonade, and maybe catch passing traffic (instead of kicking you off when they see your success, and starting their own lemonade stand which fails dismally).&lt;/p&gt;
&lt;p&gt;I think a few examples are in order: how come people put google search on their website long before they would put yahoo? Google is a nice neighbour! google recognises that helping you make money helps them make money, they facilitate and help you grow, while they grow (and they grow because you grow). It comes back to the Google &lt;a href=&quot;http://investor.google.com/conduct.html&quot;&gt;Code of Conduct&lt;/a&gt; which basically says Don&#039;t be evil. Being evil is trying to steal or control revenue streams (as opposed to dipping into the stream, or making the stream bigger so everyone can play).&lt;/p&gt;
&lt;p&gt;The point of this ambling warble? The South African web industry needs a serious shake up, companies need to start waking up to the w3c and it&#039;s recommendations (it goes beyond just code - the w3c thinks about accessibility, etc.). The industry needs to start understanding the web as a community, and the fact that the play ground is so big it doesn&#039;t make sense to try and cordon of your corner of the web, spin some razor wire around it, and force people to use the intercom to come and play on your swings. In a related thing I have always been boggled when people talk about catering for mobile media, and reaching mobile phone browsers, etc. They build specialist websites and engines, just to make the site usable from a cellphone (don&#039;t get me wrong, I am all about sites making tweaked versions which remove stuff that is irrelevant or complex to use from a phone), when all they actually need to do is follow web standards and produce proper XHTML and CSS, and suddenly your site works on a mobile phone, looks good, and is usable for anyone and any browser. I suppose it is the hype train, and when you can charge more money to get your clients on the hype train, then greed wins.&lt;/p&gt;
&lt;p&gt;Vincent touched on the recent spate of flash only websites (and how making flash only websites is a lot like shooting yourself in the foot, because you basically trade the power of the web - hyperlinking - for a bit of glitz). Vincent didn&#039;t name the sites, but I will (I am crazy like that):&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://www.etv.co.za&quot;&gt;E-TV&lt;/a&gt; is the local free to air broadcaster. Does it make sense that I cannot link to an episode, day guide, etc. from a blog post? no, it doesnt. Their website is a wonderful testament to the white elephant (in the box, at the back of the cupboard in the basement, that can only be reached using the stairs).&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.sterkinekor.com/&quot;&gt;Ster-Kinekor&lt;/a&gt; is another site that probably implemented an entire toolkit in flash, just to do what html was designed for. Updates are probably a whore for some lowly paid minion, and again, how can I link to a movie I want to see? How do I put a widget on my sidebar that tracks the movies I have watched (maybe even pulled from my ster-kinekor card)? oh, right, not possible.&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.entertainmentafrica.com/&quot;&gt;Entertainment Africa&lt;/a&gt; is TelkomMedia&#039;s little jaunt (at a cost to the tax payer, and anyone who pays telkom for anything) into becoming an entertainment hub for ZAers. Luckily no one can actually link to any sub-section of the site, so they won&#039;t get too much additional traffic from their users. The flashing &quot;loading&quot; text makes me bring up a little&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Any surprises that they are oldmedia houses and they clearly got sold the whole hook line and sinker? Two of those sites were made by a local company called (&lt;acronym title=&quot;Laugh out loud&quot;&gt;lol&lt;/acronym&gt;) &lt;a href=&quot;http://www.prezence.co.za/&quot;&gt;Prezence&lt;/a&gt;. No surprises that they are a flash house (probably copy-pasted directly from the 90s). I guess they really have a solid prezence (sp?) on the internet. They certainly make their prezence (sp?) felt. I hope I am going to get nice prezence for my birthday (which is just around the corner).&lt;/p&gt;
&lt;p&gt;I know I am a minimalist, and the sites could look worse than they do, but when I see all the glitzy flash, and sliding things all over the place, it makes me mock charge a bit, but maybe that is related to feeling like the sites are alive and trying to attack my eyes.&lt;/p&gt;
&lt;p&gt;So, shake and bake SA, you have been warned.&lt;/p&gt;
</description>
 <comments>http://whijo.net/blog/brad/2007/08/29/south-african-web-development-companies.html#comments</comments>
 <category domain="http://whijo.net/tags/bad-website">bad website</category>
 <category domain="http://whijo.net/tags/good-website">good website</category>
 <category domain="http://whijo.net/tags/internet">internet</category>
 <category domain="http://whijo.net/tags/south-africa">south africa</category>
 <category domain="http://whijo.net/tags/web-development">web development</category>
 <pubDate>Wed, 29 Aug 2007 11:15:07 +0200</pubDate>
 <dc:creator>brad</dc:creator>
 <guid isPermaLink="false">114 at http://whijo.net</guid>
</item>
<item>
 <title>Hosting</title>
 <link>http://whijo.net/services/services/hosting</link>
 <description>&lt;p&gt;We have very reasonable hosting fees, provided you are someone we want to host. We like to host Open Source projects, NGOs, i.e. anyone involved in social good can probably find a home here.&lt;/p&gt;
&lt;p&gt;Please &lt;a href=&quot;contact&quot;&gt;contact us&lt;/a&gt; for a quote.&lt;/p&gt;
</description>
 <category domain="http://whijo.net/tags/hosting">hosting</category>
 <category domain="http://whijo.net/tags/internet">internet</category>
 <category domain="http://whijo.net/tags/ngo">ngo</category>
 <category domain="http://whijo.net/tags/open-source">open source</category>
 <category domain="http://whijo.net/tags/php">php</category>
 <category domain="http://whijo.net/tags/python">python</category>
 <category domain="http://whijo.net/tags/websites">websites</category>
 <pubDate>Sun, 24 Jun 2007 19:23:59 +0200</pubDate>
 <dc:creator>brad</dc:creator>
 <guid isPermaLink="false">101 at http://whijo.net</guid>
</item>
<item>
 <title>Python and cybersmart Caps</title>
 <link>http://whijo.net/blog/brad/2007/06/24/python-and-cybersmart-caps.html</link>
 <description>&lt;p&gt;I recently got DSL at home (&lt;a href=&quot;http://nml.ru.ac.za/blog/brad/2007/05/24/one-goes-out-telkom.html&quot;&gt;after 22 working days&lt;/a&gt;), and signed up with a local ISP (&lt;a href=&quot;http://www.cybersmart.co.za&quot;&gt;cybersmart&lt;/a&gt; - you can tell them &lt;a href=&quot;mailto:bwhittington@cybersmart.co.za&quot;&gt;bwhittington@cybersmart.co.za&lt;/a&gt; referred you) because it was the &lt;a href=&quot;http://www.hellkom.co.za/ispprices/adsl-3gb.php&quot;&gt;cheapest 3 Gig cap&lt;/a&gt; available. What I also like about them is they provide a very simple web page that helps you keep track of your usage. I knew a bit of python, and I wanted to further my skills, so I decided to tap out a python script to bring my cap usage to the desktop. The result:&lt;/p&gt;
&lt;p&gt;&lt;span class=&quot;inline&quot;&gt;&lt;a href=&quot;http://whijo.net/files/cybersmart-cap.png&quot; class=&quot;inline-image-link&quot; title=&quot;View: cybersmart-cap.png&quot; rel=&quot;lightbox[gp_inline]&quot;&gt;&lt;img src=&quot;http://whijo.net/files/imagecache/inline_resize/files/cybersmart-cap.png&quot; alt=&quot;cybersmart-cap.png&quot; title=&quot;cybersmart-cap.png&quot;  class=&quot;inline&quot; /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;What this re-iterated for me is that python is awesome, linux is awesome, gnome is awesome, and python is awesome. You can get python wrappers for just about everything, and more and more programs include python as an avenue to build extensions (my first non-django, python project was a rhythmbox plugin that pauses the music when your screensaver turns on). &lt;/p&gt;
&lt;p&gt;So I started out on the problem. It was a pretty straightforward issue: download the html from cybersmart, walk the &lt;abbr title=&quot;Document Object Model&quot;&gt;DOM&lt;/abbr&gt;, grab the elements with the relevant data, typecast the data to a floating point number, and, for cream, calculate daily averages (per day usage, per day remaining). Finally, display the data. For this little project I used urllib, pyxml, pynotify (a thin wrapper around libnotify), datetime and time (you can download the full file as an attachment to this blog post).&lt;/p&gt;
&lt;p&gt;We start with the data, the cybersmart page looks like this:&lt;/p&gt;
&lt;p&gt;&lt;span class=&quot;inline&quot;&gt;&lt;a href=&quot;http://whijo.net/files/cap-summary.png&quot; class=&quot;inline-image-link&quot; title=&quot;View: cap-summary.png&quot; rel=&quot;lightbox[gp_inline]&quot;&gt;&lt;img src=&quot;http://whijo.net/files/imagecache/inline_resize/files/cap-summary.png&quot; alt=&quot;cap-summary.png&quot; title=&quot;cap-summary.png&quot;  class=&quot;inline&quot; /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;The relevant bits of information are the &quot;Used for this month&quot; and &quot;Total left for month&quot;. Luckily these are stored in elements with class names that are relevant (although they do reuse the same class name for multiple things, instead of doing a class=&quot;used usedTotal&quot; and a class=&quot;remaining remainingTotal&quot;, and styling the relevant classes, while getting the semantic meaning, and visual identity across). &lt;/p&gt;
&lt;p&gt;So, we download the file (sending relevant log in details as a POST), and send it to the HtmlReader class of pyxml:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;print(&quot;Downloading HTML&quot;)
data = urllib.urlencode(
  {   &quot;accountName&quot;:&quot;account@cybersmart.co.za&quot;,
      &quot;password&quot;:&quot;password&quot;,
      &quot;login&quot;:&quot;login&quot;})
f = urllib.urlopen(
      &quot;http://www.cybersmart.co.za/getAccountDetails.cgi&quot;,
      data
    )
doc = f.read()
f.close()
reader= HtmlLib.Reader()
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;
Then we parse the document, and walk the DOM tree, pulling out relevant info (sidebar: I couldn&#039;t do this more efficiently than pulling out all the td&#039;s and then checking each class entry, the getElementByClass doesn&#039;t seem to work out properly?? I also cheat because there are multiple savedTotal elements, but I am only worried about the last one):&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;print(&quot;Parsing Document&quot;)
dom = reader.fromString(doc)

print(&quot;Walking the tree&quot;)
td_elements = dom.getElementsByTagName(&quot;td&quot;)
remaining=&#039;&#039;
used=&#039;&#039;
for td in td_elements:
        temp = td.attributes.getNamedItem(&#039;class&#039;)
        if temp:
                if temp.value == &quot;savedTotal&quot;:
                        remaining=collect_text(td)
                if temp.value == &quot;usedTotal&quot;:
                        used=collect_text(td)

&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;
Now we have strings in our &quot;remaining&quot; and &quot;used&quot; variables which we can easily typecast to floats and process them further. I used some helper functions that I found on the net for dealing with number of days past and remaining in the month, I didn&#039;t note where they came from, so apologies to the author.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;print(&quot;Caluclating averages&quot;)
daysleft = 
    mkLastOfMonth(datetime.datetime.now())-datetime.datetime.now()
daysleft = daysleft.days
remaining_float = float(remaining)
used_float = -float(used)
days = int(datetime.datetime.now().strftime(&quot;%d&quot;))
&lt;/pre&gt;&lt;p&gt;&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Then, the magic...displaying the data as a notification bubble is flipping simple, you just import pynotify, initialise it with your namespace, and tell it what to display. You can get wrappers that allow you more flexibility for your notification (like images etc.), but I didn&#039;t need it.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;print(&quot;Displaying data&quot;)
usage=
   &quot;%.2f Gb used in %s days\nUsage average of %.2f Mb&quot; % 
   (used_float,days,(used_float*1000)/days)

projected=
   &quot;\n\n%s days left to use %s Gb\ndaily allowance of %.2f Mb&quot; % 
   (daysleft,remaining,(remaining_float*1000)/daysleft)

content = &#039;&#039;.join([usage,projected])
pynotify.init(&quot;cybersmart&quot;)
n = pynotify.Notification(&quot;Cybersmart Remaining Cap&quot;,content)
n.show()
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;
It is not the most wonderful, or extensible code ever, but it works for me, and hopefully this can help someone else do something else. I would like to find a platform agnostic way to do notifications, and I have found some code to build a platform agnostic systray icon (which could keep track of you usage daily as a graph, and pop up a detailed notification when clicked). Splitting the code into classes would allow it to become more extensible in that multiple ISPs could be catered for using different approaches, with the same display code. &lt;/p&gt;
&lt;p&gt;I am stoked with how easy it was to roll it together (POSTing, downloading, parsing, processing and display in just over 30 lines), how easy it was to hook into libnotify (the freedesktop notification lib) for display. I have upgraded from edgy to feisty (which bumped python from 2.4 to 2.5) and it wasn&#039;t bothered either. You will need to install python-xml, and python-notify. The nice thing is that this is also an appropriate area for python, since it is just message passing.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Update 24/06/2007 - &lt;a href=&quot;http://vhata.rucus.net&quot;&gt;Jonathan&lt;/a&gt; pointed out &lt;a href=&quot;http://www.crummy.com/software/BeautifulSoup/&quot;&gt;BeautifulSoup&lt;/a&gt; as a more appropriate alternative to htmllib&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;As a side note, I fell in love with &lt;a href=&quot;http://www.python.org&quot;&gt;python&lt;/a&gt; when I learnt it so I could program in &lt;a href=&quot;http://www.djangoproject.com&quot;&gt;Django&lt;/a&gt;. I have slowly been trying to spread my python wings beyond simply writing web apps, because it is a flipping rad language, with awesome readability, and crazy power. I suppose you could say I script in python, because python is interpreted at run time, then all the java programmers are scriptors too, so ne ner ne ner ne ner.&lt;/p&gt;
</description>
 <comments>http://whijo.net/blog/brad/2007/06/24/python-and-cybersmart-caps.html#comments</comments>
 <category domain="http://whijo.net/tags/cybersmart">cybersmart</category>
 <category domain="http://whijo.net/tags/geek">geek</category>
 <category domain="http://whijo.net/geek-tags/gnome">gnome</category>
 <category domain="http://whijo.net/tags/internet">internet</category>
 <category domain="http://whijo.net/tags/isp">ISP</category>
 <category domain="http://whijo.net/geek-tags/lazyweb">lazyweb</category>
 <category domain="http://whijo.net/geek-tags/libnotify">libnotify</category>
 <category domain="http://whijo.net/geek-tags/linux">linux</category>
 <category domain="http://whijo.net/geek-tags/python">python</category>
 <category domain="http://whijo.net/geek-tags/snippet">snippet</category>
 <category domain="http://whijo.net/geek-tags/tutorial">tutorial</category>
 <enclosure url="http://whijo.net/files/cybersmart.py.txt" length="2915" type="text/plain" />
 <pubDate>Sun, 24 Jun 2007 10:07:17 +0200</pubDate>
 <dc:creator>brad</dc:creator>
 <guid isPermaLink="false">99 at http://whijo.net</guid>
</item>
</channel>
</rss>
