Jump to content

Question about script


Recommended Posts

Hi there!

I`m new in the forum and I`m a newbie, so can someone help me on small script.

i`m using ff.au3 and mozrepl for using mozilla firefox. So I go to an exact webpage and use _FFsearch to find an exact phrase. I`m searching for "site visited:" and there`s a number just after it. How can I get that number?

Thank you in advance!

Link to comment
Share on other sites

You would need to use StringRegExp to search for site visited: then grab the numbers after.

Unfortunately I'm not very good at StringRegExp yet :mellow:

010101000110100001101001011100110010000001101001011100110010000

001101101011110010010000001110011011010010110011100100001

My Android cat and mouse game
https://play.google.com/store/apps/details?id=com.KaosVisions.WhiskersNSqueek

We're gonna need another Timmy!

Link to comment
Share on other sites

Or for the lazy (me)

StringinStr and then StringLeft and StringRight ! haha

Thank you, both of you!

But don`t think you got me right :mellow:

For example the script goes to this page - http://www. youtube. com/watch?v=3O67YupAgGg (a video clip in youtube)

So for example the script searchs for "likes". And the number of likes is just in front of the phrase, so how can I get that number?

Thank you in advance!

Edited by Phasebook
Link to comment
Share on other sites

hi Phasebook,

You can use BinaryToString(InetRead("http://www.yourwebsitehere.com")) to grab the page's source, then use StringRegExp as kaotkbliss suggested to extract the information you need.

Here is a quick example :mellow:

$sSource = BinaryToString(InetRead("http://www.youtube.com/watch?v=3O67YupAgGg"))
$aTitleArr = StringRegExp($sSource, '(?U)<meta name="title" content="(.*)">', 3)
$aLikesArr = StringRegExp($sSource, '<span class="likes">(\d+)</span>', 3)
MsgBox(64, $aTitleArr[0], $aTitleArr[0] & " has " & $aLikesArr[0] & " likes.")

Hope this helps, :)

-smartee

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...