|
using System;
using System.Data;
using System.Configuration;
using System.Web;
using Microsoft.Web.Services;
using System.Xml;
using System.Net;
namespace FlickrSpell
{
public partial class FlickrBridge : BridgeHandler
{
public override void TransformRequest()
{
string letter = this.BridgeRequest.Args["letter"] as string;
string replacement = letter;
switch (letter.ToLower())
{
case "a":
replacement = "aa";
break;
case "i":
replacement = "ii";
break;
case "0":
case "1":
case "2":
case "3":
case "4":
case "5":
case "6":
case "7":
case "8":
case "9":
this.BridgeRequest.Args["group_id"] = "54718308@N00";
break;
};
this.BridgeRequest.Args["letter"] = replacement;
base.TransformRequest();
}
public override void TransformResponse()
{
string responseXML = this.ServiceResponse.Response as string;
XmlDocument doc = new XmlDocument();
doc.LoadXml(responseXML);
string responseStatus = doc.SelectSingleNode("/rsp/@stat").Value;
if (string.Compare(responseStatus, "ok", true) != 0)
{
throw new Exception(doc.SelectSingleNode("/rsp/err/@msg").Value);
}
base.TransformResponse();
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.