Today's exercise comes in the form of gardening rather than cycling and so I have spent the day being attacked by spiky plants and I have the marks to prove it! After my token outdoor exposure, it was back to the computer to tackle today's challenge - the twitter widget.
Since I worked out how to use the Magpie RSS reader for PHP, it was tempting to fall back on that rather than use twitter's own JavaScript widget. It does have several advantages in that it can cache the feed rather than having to get live results each time, it is more search engine friendly than a JavaScript implementation as well but with that said, I would be putting more of a load on my own server by doing it this way too.
I decided to go with the JavaScript twitter widget because it seemed very customisable in order to fit it in with my current theme. Turns out it isn't that customisable at all. It is made up of many many small components and a messy heap of CSS confined to a single line. It really annoys me when websites don't have well laid out code and I haven't yet worked out whether this is deliberate to hamper attempts to copy code or whether omitting the newline character helps reduce bandwidth. When you consider how many people access these pages, I suppose it could make a considerable difference but it still makes reading it pretty difficult.
After a good couple of hours, I had narrowed it down to a 1px padding which showed up as an annoying right border. I couldn't override it in my CSS for some reason as it was being overridden each time the page was loaded. That's the problem with CSS, the cascading bit means that the last value given holds and as the CSS document is one of the first things loaded, there is more of a chance for something to overwrite it later on. In fairness, this is usually more of a positive than a negative point but nevertheless, in this case it was bad! I eventually solved it by changing the colour of the border to blend in with the background. Technically it's still there but as you can't see it, no one will know.
Saturday, 3 July 2010
A Spot of Gardening
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment