CSTrüter HomeArticlesDownloadsAbout meContact me
a quick look at how to create a windows service using C# 2010-02-28 21:48:06
How to call server-side code from client-side code, using PageMethods in ASP.net 2010-02-21 12:31:27
How to pass a set of data to an xml type in SQL 2005/8 2010-02-12 19:04:23
Some funky behaviour regarding overload Resolution of dynamic/object types 2010-02-09 17:16:52
Object orientated programming within JavaScript 2010-01-28 07:25:45
How to sort data using ASP.net (C#) and SQL 2005/8 2010-01-18 15:23:14
Quick look at some of the new features added to C# 4.0 2010-01-12 21:52:13
SQL 2008 introduced a nifty feature called Table-Valued Parameters (TVP) into its codebase 2010-01-06 22:58:25
How to page data using ASP.net (C#) and SQL 2005/8 2009-10-19 15:01:45
a post about sql joins 2009-09-20 15:50:57
Creating a WYSIWYG textbox for your website is actually quite simple. 2007-02-01 12:00:00
Move items between two listboxes in ASP.net(C#, VB.NET) and PHP 2008-06-12 17:07:43
Firefox word wrapping issues 2008-06-09 09:51:21
2007-02-22 12:00:00
Blog about passing parameters by reference to functions using func_get_arg(s) 2008-07-27 12:38:24
Download the demo code I started my RSS adventures scripting a javascript RSS Reader and posted it on hotscripts as a download. Most people really liked it, despite the fact that javascript doesn't allow you to read remote files in certain browsers. I feel that it would make a lot more sense doing something like this in a server side language like PHP/C# (which allows it) etc - since rss files are normally remotely hosted, which defeats the purpose if you cant read them remotely. If you however want to go this route there is always ways to get around this issue, like copying the rss file to the server where the script is running on, or more preferrably making use of a script that acts as a proxy, simply pass your url to the proxy script and return xml from it.(like you'll see below)
<?php header ("content-type: text/xml"); echo file_get_contents($_REQUEST['url']); ?>
<%@ WebHandler Language="C#" Class="rssremote" %> using System; using System.Web; using System.Xml; using System.IO; public class rssremote : IHttpHandler { public void ProcessRequest (HttpContext context) { context.Response.ContentType = "text/xml"; XmlDocument xdoc = new XmlDocument(); xdoc.Load(context.Request.QueryString["url"]); context.Response.Write(xdoc.OuterXml); } public bool IsReusable { get { return false; } } }
<%@ WebHandler Language="VB" Class="rssremote" %> Imports System Imports System.Web Imports System.Xml Imports System.IO Public Class rssremote : Implements IHttpHandler Public Sub ProcessRequest(ByVal context As HttpContext) Implements IHttpHandler.ProcessRequest context.Response.ContentType = "text/xml" Dim xdoc As New XmlDocument() xdoc.Load(context.Request.QueryString("url")) context.Response.Write(xdoc.OuterXml) End Sub Public ReadOnly Property IsReusable() As Boolean Implements IHttpHandler.IsReusable Get Return False End Get End Property End Class
function RSS(url) { this.items = new Array(); try { var xmlDoc = (document.all) ? new ActiveXObject("Microsoft.XMLDOM") : document.implementation.createDocument("","",null); xmlDoc.async = false; xmlDoc.load('rssremote.php?url=' + escape(url)); this.title = getElement(xmlDoc, 'title'); this.link = getElement(xmlDoc, 'link'); this.description = getElement(xmlDoc, 'description'); var items = xmlDoc.getElementsByTagName('item'); for (var i = 0; i < items.length; i++) { this.items[i] = new function() { this.title = getElement(items[i], 'title'); this.description = getElement(items[i], 'description'); this.link = getElement(items[i], 'link'); } } } catch(e) { alert(e.message); } function getElement(parent, tagName) { return parent.getElementsByTagName(tagName)[0].firstChild.nodeValue; } }
function RSS(url, elementID) { var html = document.getElementById(elementID); var xmlhttp = (window.XMLHttpRequest) ? new XMLHttpRequest() : new ActiveXObject("Microsoft.XMLHTTP"); if (xmlhttp) { html.innerHTML = '<img src="img/ajax-loader.gif" />'; xmlhttp.onreadystatechange = function() { if (xmlhttp.readyState==4) { var html = document.getElementById(elementID); try { html.innerHTML =(xmlhttp.status == 200) ? xmlhttp.responseText : "RSS failed to load, error " + xmlhttp.status; } catch(ex) { html.innerHTML = ex.description; } } } xmlhttp.open("GET", "php/xmlhttp.php?url="+escape(url),true); xmlhttp.send(null); } }
No Entries Found
Codebooth my semi-community site etc (work in progress)
The company I'am currently working for as software developer.
a Parallel reference of programming languages 2009-09-10 12:48:23
a tutorial explaining how to develop a simple login using PHP and MySQL 2009-09-05 18:26:47
An article looking at adding some kind of event driven model to PHP 5 2008-07-28 12:48:09
It is very simple creating your own rss reader, the following article looks at a few methods of doing this. 2008-06-23 13:18:25
A quick reference about working with dropdown boxes (select element) in javascript. 2007-02-17 16:36:41
Collection of funny programming articles 2006-10-08 14:23:43