Jump to content


Photo

Get ubot to count characters?


  • Please log in to reply
2 replies to this topic

#1 beatngu

beatngu

    Advanced Member

  • UBot Users
  • PipPipPip
  • 167 posts
  • Location3021e68df9a7200135725c6331369a22
  • OS:Windows 7
  • Total Memory:More Than 9Gb
  • Framework:v3.5 & v4.0
  • License:Dev

Posted 14 March 2012 - 04:12 AM

Hi all,
Is there a way to get ubot to count characters when scraping the content?

I looked for a javascript but i had no luck finding one.
What i need is something that count characters,so if i scrape a 1000 char long text i want to set ubot to use 400 chars when posting to my short description field and use the rest of the 600 chars on the full description field.

The best option would be to count the chars when scraping so that i get one short and one long description but i guess scraping the whole text would also work as long as ubot can splitt up the text to 400 and 600 before posing it on my website.

KARMA is a B*ICH  :P


#2 JohnB

JohnB

    Advanced Member

  • UBot Users
  • PipPipPip
  • 3350 posts
  • LocationNJ
  • OS:Windows 7
  • Total Memory:8Gb
  • Framework:v3.5 & v4.0
  • License:Dev

Posted 14 March 2012 - 04:56 AM

You could scrape using the substring function (0,400):

ui stat monitor("# of Chars: ", $text length(#text))
navigate("http://www.lipsum.com/", "Wait")
click(<name="generate">, "Left Click", "No")
wait(3)
set(#text, $substring($scrape attribute(<id="lipsum">, "innertext"), 0, 400), "Global")




John

#3 beatngu

beatngu

    Advanced Member

  • UBot Users
  • PipPipPip
  • 167 posts
  • Location3021e68df9a7200135725c6331369a22
  • OS:Windows 7
  • Total Memory:More Than 9Gb
  • Framework:v3.5 & v4.0
  • License:Dev

Posted 14 March 2012 - 08:07 AM

Thanks,to be honest i have never used that substring command.

KARMA is a B*ICH  :P





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users