How does the syndication part of RSS work? - rss

I understand how to make an RSS file. The XML for it is simple enough. But do I have to anything special for updates to get distributed or do I just need to update the file periodically and the rest will take care of itself? All of the stuff I've found on rss talk about what it does but not so much how.

Clients periodically or occasionally re-download your RSS resource, based in part on the update schedule you can suggest in the RSS data itself. If the clients retained what they downloaded before, then they can notice what's new from last time.

Related

Developing a news feed system

I am developing a system that has a database for news headlines from various sources. I have not worked with RSS before so I am confused about a lot of things. Can anyone please point a good tutorial for how to develop such a thing? Thanks
In my mind, I have questions like:
1) How will I get the latest news feed? do I have to check the rss feed link every few minutes and see If it's different than the previous one?
2) Is it a good practice to parse the feed xml myself or use a feed reader kind of thing?
3) Will I have any control over the feed sent to me. e.g I only need news feed for Google or Intel.
RSS is a very standard format you can start learning at w3c school.
About your questions.
If you can talk with the RSS provider, maybe they can notify each time
something new comes. They can use, for example,
XML-RPC notification.
You can also ask the RSS provider how often should you check the feed
(in case they cannot provide any kind of notification).
I think it's better to develop your own bot. There is lot of
frameworks that can deal with rss format. In case you are working with C# you can try with SyndicationFeed Class
I'm not sure if I'm undestanding your problem, but if the provider
puts a RSS link at your disposal, you must actively navigate that
feed. When you have that feed, you can work with the metadata in
order to see what's interesting for you. For example checking "category" or "channel" node.

ASP.Net: Generating a file to download

I have a file that I need to copy, run a command against the copy that specializes it for the person downloading it, and then provide that copy to a user to download. I'm using ASP.Net MVC2, and I've never done anything like this. I've searched around for the simplest way to do it, but I haven't found much, so I've come up with a plan.
I think what I'll do is generate a guid, which will become the name of a folder I'll generate at the same level of the source file that the copy is made from. I'll then copy the file to that folder, run my command against it, provide a link to the file, and I'll have some service that runs every now and then that deletes directories that are more than a day old.
Am I over thinking this? Is there an easier, simpler, or at least more formal way to do this? My way seems a bit convoluted and messy.
Can you process in memory and stream it to the client with a handler?
That is how I do things like this.
Basically, your download link points to an HttpHandler, typically async, that performs the processing and then streams the bits with a content-disposition of 'attachment' and a filename.
EDIT: I don't do much MVC but what Charles is describing sounds like and MVC version what I describe above.
Either way, processing in memory and streaming it out is probably your best bet. It obviates a lot of headaches, code and workflow you would have to maintain otherwise.
What sort of command do you have to run against it?
Because it would be ideal to process it in memory in a controller's action using MVC's FileResult to send it to the client.
Charles

How is the file uploading progress reported?

I have been trying to implement an ajax-style file upload. I was wondering what we must do to report the uploading progress. I am trying to implement this in my asp.net web page.
I understand the mechanism by which we can upload a file, ajax-style, on a web page. I have been googling a lot about how to show a progress bar, but I don't see proper explanations. But I've come to understand that we have to manage this from the server-side some how. (cf file upload progress)
Any ideas/code would be appreciated. Thanx in advance.
I'm not sure why you want to roll your own, as there are a number of upload controls using Ajax, Flash, Silverlight, etc. Nonetheless, the concept is all about querying for progress and returning the current state. This guy went through the same process and shows how he built a component using jQuery.
Displaying progress requires your client getting feedback from your server. This means repetitive queries to your server to get progress. Display the progress on your client using that information.
On your server, you have to not only accept the inbound file upload but also respond with the aggregate progress. It's easy if you get the Content-Length header passed along in the request; the problem lies in that you won't be able to rely on having that information. There are strategies for dealing with this, but it requires you to have code that accepts the uploaded file as you're going to have to read the inbound bits.
At this point, you have other things to care about that are well beyond the scope of a progress bar, such as dealing with large file uploads in-process of your web server (out-of-process is much less detrimental to your server.)
Because of the complexities involved, I would encourage you to find an existing component instead of creating your own.

Which is better for a dependency: Web Service vs XML?

I’m creating an application that has a data dependency on another group’s data feed. They can give me a daily xml dump of the data that I can simply load into cache once a day OR I can make calls to a web service to get the data that way. If the data provider doesn't care which I use (same work for them either way) which should I ask for and why? Using asp.net cache web site etc…
This depends entirely on the API exposed by their web service. If you are in a situation where you will need all the information, all at once, once a day, and there is no need to ever ask for anything more, then a simple XML reader may be all that you need.
On the other hand, the much more extensible solution is to hook into their web service, because then you can customize what kind of information you are gathering. If your requirements could update during the course of a day, or you don't need ALL the information, just a subset at any given time, then going through the web service may be better.
Ultimately, the better option depends on the business requirements. Would their web service be able to give you information that is formatted in a more useful way, and filtered in a relevant way? If so, you should go that route. If all you need is ALL the data, then XML might be simpler.
For this I'd choose to get an Atom feed, from which you can take the benefits of HTTP for caching and updating, and is also a valid XML feed. This way you don't have to process more data than what you actually need. XML dumps can be terrible for updates, analysis and implementation, while WebServices are terrible in general as you need to grok the WS-* stack of standards until your requirements are met (and possibly pollute your development environment with tools you rarely need). Alternatively I'd ask for a basic REST interface into the data, say one URL pr. day of updates or whatever you think you need.

Xml tool to test xml data

I'm in a project that loads a lot of XML from web services and I need to send the correct one and get the one I am expecting, a part that run the web app in Debug mode and add a breakpoint after getting the XML String, what can I have as a free plugin or even a trial program to let me see what XML is sending by my web application and what XML is been received by it?
Hope that I make sense.
I'm not sure what protocols you are using but Wireshark should show you for free :-)
Wireshark's most powerful feature is
its vast array of display filters
(over 80000 as of version 1.0.5). They
let you drill drill down to the exact
traffic you want to see and are the
basis of many of Wireshark's other
features, such as the coloring rules.
http://www.wireshark.org/docs/dfref/

Resources