Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

.NET 

How to print data off php webpage?

Let's say i want to go to the page

http://extalia.net/index.php

And get the amount of players online, the number. And print it out into my vb.net form. So something like,

Dim Derp As String = web address
Dim Derp2 As String = Replace("Online", "")

Label1.text = Derp2




Of coarse in the above I need to somehow read the php and search for the line with the specific string "online" and print out the entire string


Any advice?
if u just have text in the index then all u need is to use webclient downloadstring with the url which return the text
(Jul 27, 2015 08:04 AM)Only3 Wrote:  if u just have text in the index then all u need is to use webclient downloadstring with the url which return the text

Can you explain a bit more for me.
Label1.text = New Net.WebClient().DownloadString("http://extalia.net/index.php")
[Image: FzuqHzX.png]

EDIT: Don't actually name your MyBase.Load handler "Load", it's bad naming and I only did it because I was too lazy to click the form.
(Jul 27, 2015 08:41 AM)log dot zip Wrote:  [Image: FzuqHzX.png]

EDIT: Don't actually name your MyBase.Load handler "Load", it's bad naming and I only did it because I was too lazy to click the form.

I was about to point our your naming of the FormLoad event, then saw the edit at the bottom.
(Jul 27, 2015 08:41 AM)log dot zip Wrote:  -snip

What do you think of this pattern instead?

Code
(\d+\,*\d*) ONLINE
(Jul 27, 2015 10:01 AM)Odus Wrote:  What do you think of this pattern instead?

Code
(\d+\,*\d*) ONLINE

I mean, they match the exact same things, just in different ways. :P
edit: Odus's does not use | (or), which in my eyes makes it cleaner (still matches the exact same things however), replace the regex with that instead.
(Jul 27, 2015 10:01 AM)Odus Wrote:  What do you think of this pattern instead?

Code
(\d+\,*\d*) ONLINE

@Odus
@CodeConfusion

What if the website had "3,86,600 ONLINE" ? What you then gon do big bois?
(Jul 27, 2015 10:16 AM)+Haze Wrote:  @Odus
@CodeConfusion

What if the website had "3,86,600 ONLINE" ? What you then gon do big bois?

Congratulate them on the unrealistic numbers they've been getting recently.
LOOOOOOL, you never know though, one day they could be hitting a milli views. Anway

Code
((\d+\,)+\d+) ONLINE
(Jul 27, 2015 10:16 AM)+Haze Wrote:  @Odus
@CodeConfusion

What if the website had "3,86,600 ONLINE" ? What you then gon do big bois?

Since we're both nitpicking: not possible as 36,86,600 is not a real number.

Lets be realistic though, the site will likely not breach 999,999 online users at any given time. If it does, then you can account for it with your pattern, but even still... 2 capture groups?
Yeah nitpicking ftw. And tru tru tru, I could use a char class.

Code
([\d+\,]+\d+) ONLINE

But yeah I doubt the site would reach 1 mill views lol


Possibly Related Threads...
Thread / Author Replies Views Last Post
[C] by ShallowMEFeb 17, 2020 07:08 PM 20 523 Feb 17, 2020 07:08 PM
Last Post: 0xDEAD10CC
[Python] by Red-LeonardOct 23, 2019 09:46 PM 4 153 Oct 23, 2019 09:46 PM
Last Post: Red-Leonard
[Java] by cryptobassboostMay 20, 2019 11:49 AM 4 249 May 20, 2019 11:49 AM
Last Post: bluriy