Login Register






Thread Rating:
  • 0 Vote(s) - 0 Average


Tutorial Getting data from web? filter_list
Author
Message
Getting data from web? #1
Hey everyone,

I currently am making a program which checks your pm's on a site.

Atm, it just has login system, which does work through web request.

But I was wondering, how can I make it so I can check pm's on the site, like how can I make a button check for the text " You have X number of private messages etc, also how can I make it so if it says 1 message, or 2 message etc, a label says how many too?

Thanks.
[Image: Ldss8XF.png]

Reply

RE: Getting data from web? #2
You would need to do a login request, then scan the page by either using REGEX or SPLIT, find Private Messages (Unread X, Total Y), then you would need to parse out the UNREAD X variable.

Reply

RE: Getting data from web? #3
(08-12-2013, 07:57 PM)Xanii Wrote: You would need to do a login request, then scan the page by either using REGEX or SPLIT, find Private Messages (Unread X, Total Y), then you would need to parse out the UNREAD X variable.

I have login, that works fine atm, also what are REGEX/SPLIT?

Are they external programs?Tongue
[Image: Ldss8XF.png]

Reply

RE: Getting data from web? #4
(08-12-2013, 07:58 PM)Villain Wrote:
(08-12-2013, 07:57 PM)Xanii Wrote: You would need to do a login request, then scan the page by either using REGEX or SPLIT, find Private Messages (Unread X, Total Y), then you would need to parse out the UNREAD X variable.

I have login, that works fine atm, also what are REGEX/SPLIT?

Are they external programs?Tongue

No, they are libraries built-in to the .NET framework.
Essentially what they do is parse text to give you for example what xanii told you, an variable.
Google them up.
[Image: tumblr_m4vms28lYu1qj3ir1.gif]

Reply

RE: Getting data from web? #5
Use Httpwebrequest / response to get the sites sourcecode and filter the read/unread messages by Regex. Then Display the numbers e.g. in a label. Done.

Reply

RE: Getting data from web? #6
[code=vbnet]'WebClient Example
Dim W As New WebClient
Dim source As String = W.DownloadString("http://www.codecommunity.net/")
Dim TotalUnread As String = Split(source, "(Unread ")(1).Split(",")(0)[/code]
[Image: CDUAq9d.png]

Reply

Re: RE: Getting data from web? #7
(08-14-2013, 05:22 PM)shebang Wrote: [code=vbnet]'WebClient Example
Dim W As New WebClient
Dim source As String = W.DownloadString("http://www.codecommunity.net/")
Dim TotalUnread As String = Split(source, "(Unread ")(1).Split(",")(0)[/code]

Didn't know it was that easy o.O


- sent from android
[Image: tumblr_m4vms28lYu1qj3ir1.gif]

Reply

RE: Getting data from web? #8
(08-14-2013, 05:24 PM)Eternity Wrote:
(08-14-2013, 05:22 PM)shebang Wrote: [code=vbnet]'WebClient Example
Dim W As New WebClient
Dim source As String = W.DownloadString("http://www.codecommunity.net/")
Dim TotalUnread As String = Split(source, "(Unread ")(1).Split(",")(0)[/code]

Didn't know it was that easy o.O


- sent from android

Split isn't hard to use Wink Apparently some people have a lot of issues with it.
[Image: CDUAq9d.png]

Reply

RE: Getting data from web? #9
(08-14-2013, 05:22 PM)shebang Wrote: [code=vbnet]'WebClient Example
Dim W As New WebClient
Dim source As String = W.DownloadString("http://www.codecommunity.net/")
Dim TotalUnread As String = Split(source, "(Unread ")(1).Split(",")(0)[/code]

So, do I put that code onto a button?

Also, how would I make the results show on a label?
[Image: Ldss8XF.png]

Reply

RE: Getting data from web? #10
(08-15-2013, 03:04 PM)Villain Wrote:
(08-14-2013, 05:22 PM)shebang Wrote: [code=vbnet]'WebClient Example
Dim W As New WebClient
Dim source As String = W.DownloadString("http://www.codecommunity.net/")
Dim TotalUnread As String = Split(source, "(Unread ")(1).Split(",")(0)[/code]

So, do I put that code onto a button?

Also, how would I make the results show on a label?

Yes, just put it on a button.
[code=vbnet]Label1.Text = "You have " & TotalUnread & " unread messages."[/code]
[Image: CDUAq9d.png]

Reply







Users browsing this thread: 1 Guest(s)