At the moment, I am generating xml and json data using the following code:
public class App
{
public string app_name;
public string app_path;
public App(string m_app_name, string m_app_path)
{
app_name = m_app_name;
app_path = m_app_path;
}
public App() { }
}
[ScriptService]
public class Apps : WebService {
List<App> App = new List<App>();
SqlConnection connection;
SqlCommand command;
SqlDataReader reader;
[WebMethod()]
public List<App> GetUserApps()
{
var apps = new List<App>();
using (connection = new SqlConnection(ConfigurationManager.AppSettings["connString"]))
{
using (command = new SqlCommand(@"some query here", connection))
{
connection.Open();
using (reader = command.ExecuteReader())
{
int AppNameIndex = reader.GetOrdinal("application_name");
int AppPathIndex = reader.GetOrdinal("application_path");
while (reader.Read())
{
apps.Add(new App(reader.GetString(AppNameIndex), reader.GetString(AppPathIndex)));
}
}
}
}
return apps;
}
}
If I then request this in javascript using application/json; charset=utf-8
, I automatically get json data.
My problem is that I need to get data from an external RSS feed, instead of a local database, and convert that to json data so I can call it the same way using javascript.
Anyone know how I can capture the RSS feed http://www.hotukdeals.com/rss/hot
using similar code as above?