vbMarkO Posted December 21, 2006 Posted December 21, 2006 I wasn't sure where else to put this question.... Here is what I am wanting to do. I have a Blog feed of which I am wanting to read ..... Here is how this blog works... its an artist blog... I'm the artist.... I am wanting to read the xml feed at http://mbstudiosdailypaintings.blogspot.com/atom.xml and within each post on the blog is a image ... I am wanting to get the image and add it to a gallery to be viewed on a web page. So each new image automatically add it to the gallery. vbMarkO Quote Visual Basic 2008 Express Edition!
MrPaul Posted December 21, 2006 Posted December 21, 2006 WebRequest and WebResponse There are three parts to this - downloading the XML feed, parsing the XML, and downloading the images. I suggest using the WebRequest and WebResponse classes: WebRequest webReq; WebResponse webResp; XmlDocument xDoc; Image dlImage; webReq = WebRequest.Create("http://mbstudiosdailypaintings.blogspot.com/atom.xml"); webResp = webReq.GetResponse(); xDoc = new XmlDocument(); xDoc.Load(webResp.GetResponseStream()); //Parse XML here //To get an image: webReq = WebRequest.Create(urlToTheImage); webResp = webReq.GetResponse(); dlImage = Image.FromStream(webResp.GetResponseStream()); //Do something with dlImage All thats needed now is code for parsing the image URLs out of the XML, and making the code more robust. Good luck :cool: Quote Never trouble another for what you can do for yourself.
vbMarkO Posted December 21, 2006 Author Posted December 21, 2006 Im sorry I guess I should of stated I dont do C# I might be able to convert it but then IM not sure here as I get turned around when it comes to C# VbMarkO Quote Visual Basic 2008 Express Edition!
MrPaul Posted December 22, 2006 Posted December 22, 2006 Conversion In this case the conversion from C# to VB.Net is simple, as no control structures have been used. Change the first 4 lines: Dim webReq As WebRequest Dim webResp As WebResponse Dim xDoc As XmlDocument Dim dlImage As Image Change comment lines // to ' Remove the trailing semicolons from all other lines If you edit your profile, you can specify your .Net preferred language, and this is displayed in your user info next to each post. :) Quote Never trouble another for what you can do for yourself.
GrenadeFX Posted January 14, 2007 Posted January 14, 2007 oldish thread but i have stumbled upon this bot, i think it is what you need: http://cyber-knowledge.net/blog/digg-irc-bot/ it reads xml files and formats it however you want im not to sure about the images tho Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.