Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Public Structure story
- Dim title As String
- Dim description As String
- Dim url As String
- End Structure 'This stores a news story from bbc or facebook
- Dim today(59) As story
- Public Sub bbcnews(byref today as story)
- Dim allnews As String
- Dim request As System.Net.HttpWebRequest = System.Net.HttpWebRequest.Create("http://feeds.bbci.co.uk/news/business/rss.xml")
- Dim response As System.Net.HttpWebResponse = request.GetResponse()
- Dim sr As New System.IO.StreamReader(response.GetResponseStream)
- allnews = sr.ReadToEnd
- For i = 0 To 19
- allnews = Mid(allnews, InStr(allnews, "<item>") + 6, Len(allnews) - InStr(allnews, "<item>") - 6)
- today(i).title = Mid(allnews, InStr(allnews, "<title>") + 7, InStr(allnews, "</title>") - InStr(allnews, "<title>") - 7)
- today(i).description = Mid(allnews, InStr(allnews, "<description>") + 13, InStr(allnews, "</description>") - InStr(allnews, "<description>") - 13)
- today(i).url = Mid(allnews, InStr(allnews, "<link>") + 6, InStr(allnews, "</link>") - InStr(allnews, "<link>") - 6)
- Next
- '----------------------------------------------------------------
- request = System.Net.HttpWebRequest.Create("http://feeds.bbci.co.uk/news/technology/rss.xml")
- response = request.GetResponse()
- sr = New System.IO.StreamReader(response.GetResponseStream)
- allnews = sr.ReadToEnd
- For i = 20 To 39
- allnews = Mid(allnews, InStr(allnews, "<item>") + 6, Len(allnews) - InStr(allnews, "<item>") - 6)
- today(i).title = Mid(allnews, InStr(allnews, "<title>") + 7, InStr(allnews, "</title>") - InStr(allnews, "<title>") - 7)
- today(i).description = Mid(allnews, InStr(allnews, "<description>") + 13, InStr(allnews, "</description>") - InStr(allnews, "<description>") - 13)
- today(i).url = Mid(allnews, InStr(allnews, "<link>") + 6, InStr(allnews, "</link>") - InStr(allnews, "<link>") - 6)
- Next
- '----------------------------------------------------------------
- request = System.Net.HttpWebRequest.Create("http://feeds.bbci.co.uk/news/science_and_environment/rss.xml")
- response = request.GetResponse()
- sr = New System.IO.StreamReader(response.GetResponseStream)
- allnews = sr.ReadToEnd
- For i = 40 To 59
- allnews = Mid(allnews, InStr(allnews, "<item>") + 6, Len(allnews) - InStr(allnews, "<item>") - 6)
- today(i).title = Mid(allnews, InStr(allnews, "<title>") + 7, InStr(allnews, "</title>") - InStr(allnews, "<title>") - 7)
- today(i).description = Mid(allnews, InStr(allnews, "<description>") + 13, InStr(allnews, "</description>") - InStr(allnews, "<description>") - 13)
- today(i).url = Mid(allnews, InStr(allnews, "<link>") + 6, InStr(allnews, "</link>") - InStr(allnews, "<link>") - 6)
- Next
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment