Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Retrieving the source of a tweet using TwitterVB
#1
Someone asked me on one of my YouTube videos how to retrieve the source of a tweet. Well here is the code. This code is meant to be directly added into the source code found in this tutorial : <!-- m --><a class="postlink" href="http://www.youtube.com/watch?v=zd2gYBsCjqI&list=UUVwwElhbjWhU">http://www.youtube.com/watch?v=zd2gYBsC ... wwElhbjWhU</a><!-- m -->

Code:
Dim source As String = ""
If entry.Source.ToString.Contains("<") Then
'Source is link, get rid of link crap
source = entry.Source.ToString.Replace("</a>", "")
Dim int As Integer = source.LastIndexOf(">")
source = source.Remove(0, int + 1)
Else
source = entry.Source.ToString
End If
'Source variable is now ready to use
n.SubItems.Add(source)
In this code, the variable named 'Source' actually contains the information about where a tweet was posted from.

Hope this helps!
My Blog | My Setup | My Videos | Have a wonderful day.


Messages In This Thread
Retrieving the source of a tweet using TwitterVB - by brandonio21_phpbb3_import2 - 08-04-2011, 09:35 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Saving and Reading oAuth Tokens with TwitterVB brandonio21 6 22,678 08-14-2011, 09:47 PM
Last Post: brandonio21

Forum Jump:


Users browsing this thread: 1 Guest(s)