I managed to shoe horn the RSS feed into the front page of Poonheads.com. You can get to it, by the way, by hitting the Home link in the menu there at the top of the page.
Now, this was a challenge for me. At work, I mostly use PHP and javaScript. In all my wisdom, however, I decided to program poonheads.com in C#.net 2.0. I hadn't touched the code in about a year and a half when I initially wrote it ( and it was fresh in my mind from my .Net programming class).
Originally, the main news post on the front page pulled from an XML page on my server. It was just a matter of changing the reference to the Blogger feed. And adjusting to the feed's new schema. Which sucked because my xml file is really simple and the blogger feed was very much not simple. So it took a lot of trial and error. I provide you now with the code. The secret was the InferSchema part. DataSet newsSet = new DataSet();
newsSet.ReadXml("http://poonheads.blogspot.com/feeds/posts/default", XmlReadMode.InferSchema);
DataRow newPost = newsSet.Tables["entry"].Rows[0];
lbl_title.Text = newsSet.Tables["title"].Rows[1][1].ToString();
lbl_poster.Text = newsSet.Tables["author"].Rows[1][0].ToString();
lbl_time.Text = newPost[1].ToString().Substring(0, 10);
String body_text = newsSet.Tables["summary"].Rows[0][1].ToString();
if (body_text.Length > 250)
{
body_text += "...";
}
a_continue.Text = "CONTINUE READING";
lbl_text.Text = body_text.Replace("\n", "<br />");
a_continue.NavigateUrl = newsSet.Tables["link"].Rows[3]["href"].ToString();
So, I don't know if that helps, but that's what it is. I don't feel like commenting or explaining it. I figure anyone who's looking at this probably knows kind of what's going on and would be able to figure it out.
I'm not really sure of a good way to display code in blogger. I'll probably just put some border around the <code>s with css. That ought to work good enough. Which brings me to my next point.
IE does not properly support .png alpha transparency. I've always known this, but never really bothered until I downloaded the RSS icon, which used alpha transparency. I didn't really want to mess with making another one, so I decided on just looking up an IE hack. I found a couple, but the results were kind of meh.
So I present to you the only foolproof 100% effective way to deal with alpha transparency in IE: Don't use alpha transparency in your pngs. Use indexed pngs or use gifs. Create your design without having to rely on transparency and everyone will be happy. The end.
So that's all I have for today. Except this random youtube video David showed me: http://www.youtube.com/watch?v=YgnloJgui1U
Until next time.
~~Ben
Wisdom Archive
- August 2008 (2)
- July 2008 (2)
- June 2008 (3)
- May 2008 (3)
- April 2008 (4)
- March 2008 (7)
- February 2008 (6)
- January 2008 (1)
- December 2007 (3)
- November 2007 (9)
- October 2007 (26)
- August 2007 (1)
- June 2007 (1)
- May 2007 (1)
- March 2007 (1)
- February 2007 (2)
- December 2006 (4)
- November 2006 (4)
- October 2006 (5)
- September 2006 (2)
- August 2006 (1)
Categories
- poonheads (22)
- music (17)
- comic (16)
- site news (12)
- coding (11)
- Classic Wisdom (10)
- video (10)
- I Love Music (9)
- javascript (9)
- photo (9)
- rant (8)
- tutorial (8)
- web design (8)
- hardware (7)
- hobby (7)
- mustaches (7)
- gear (6)
- horrifying (6)
- story time (6)
- earworm (5)
- food (5)
- art (4)
- software (4)
- Coding for Complete Noobs (3)
- movie (3)
- Captain Numbskull (2)
- Everyday Wisdom (2)
- beverage (2)
- knives (2)
- review (2)
- toys (1)
Monday, October 1, 2007
Of pngs and Feeds
Labels:
coding,
javascript,
video,
web design