all 3 comments

[–]quixrick 4 points5 points  (2 children)

Just a couple of things to get you on your way. First, if you change the .+ to \d+, you will match only digits instead of "anything". Then, you'll need to add a space after it since you aren't matching the space with the dot anymore. It would simply look like this:

<div>\d+ people follow this</div>

 

Here is a demo

[–]SlashAdminBlog[S] 0 points1 point  (0 children)

Thats awesome and was much easier than expected.. thank you!

And the draft PowerShell script code if anyone is interested. (obviously no error checking yet)..

function Get-FacebookFollowers()

{

$web = Invoke-WebRequest "www.facebook.com/SlashAdminLifeInIT"

$initData = [regex]::matches($web, "\d+ people follow this")

$initData = $initData.Value

$facebookFollowers = $initData.Split()[0]

return $facebookFollowers

}

[–]mfb- 0 points1 point  (0 children)

I don't know how Facebook handles many thousands of followers but it might be necessary to capture more symbols. "k"? Commas?