Jump to content


Photo

Wordpress Bot Advice Needed


  • Please log in to reply
7 replies to this topic

#1 stan beck

stan beck

    Member

  • UBot Users
  • PipPip
  • 22 posts
  • OS:Windows 7
  • Total Memory:4Gb
  • Framework:v4.0
  • License:Standard

Posted 06 April 2012 - 03:46 PM

UBot Newbie here - just asking for some general direction...

I need to create a bot which performs repetative tasks in wordpress - basically cycling through every post and clicking a button.

I need a loop. The only thing that I can tell on the Wordpress post page is when it comes to the last page, the right 'arrow' buttons (one is 1 page forward and the 2nd is to the end) are greyed out. Not sure how to harness that yet.

I also need to click on each link to go into the post.

Then I need to click on the the target button.

Then I need to exit out of that post and go to the next and repeat, until it gets to the last listing on a page, and then it needs to click the right arrow to go to the next page.

Thank you.

Regards,

Stan

#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 06 April 2012 - 07:38 PM

Hi Stan.

Are you talking about interacting with the front end of WP blogs or the backend?

John

#3 stan beck

stan beck

    Member

  • UBot Users
  • PipPip
  • 22 posts
  • OS:Windows 7
  • Total Memory:4Gb
  • Framework:v4.0
  • License:Standard

Posted 15 April 2012 - 07:16 AM

Hi John,

This is all backend work...

When I scrape a page of links, they, as a whole, are inserted into a single list array item (http://screencast.com/t/WAFKkS9N). So, when I want to traverse through the list to visit the links (in my case), it navigates to a full string of urls, which will never resolve...

Here is my code for your kind consideration...


define initialize everything {
clear list(%LPN Page Links)
clear cookies
}
define navigate to and login {
navigate("http://sanantonio.em...e.com/wp-admin", "Wait")
type text(<username field>, "admin", "Standard")
type text(<password field>, "adminfakepassword", "Standard")
click(<login button>, "Left Click", "No")
wait(3)
click($element offset(<class="wp-has-submenu wp-not-current-submenu menu-top menu-icon-local-page">, 1), "Left Click", "No")
}
define scrape lpn links {
wait(5)
loop(4) {
wait(4)
add item to list(%LPN Page Links, $scrape attribute(<outerhtml=w"<a href=\"http://*/wp-admin/post.php?post=*&amp;action=edit\" title=\"Edit this item\">Edit</a>">, "fullhref"), "Don\'t Delete", "Global")
wait(2)
click($element offset(<class="next-page">, 0), "Left Click", "No")
}
wait(3)
}
define process lpn links {
loop(2) {
navigate($next list item(%LPN Page Links), "Wait")
}
}
divider
initialize everything()
navigate to and login()
scrape lpn links()
process lpn links()

Thanks very much!

Stan

#4 stan beck

stan beck

    Member

  • UBot Users
  • PipPip
  • 22 posts
  • OS:Windows 7
  • Total Memory:4Gb
  • Framework:v4.0
  • License:Standard

Posted 17 April 2012 - 06:39 AM

Any thoughts?

#5 JohnB

JohnB

    Advanced Member

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

Posted 17 April 2012 - 06:57 AM

Change add item to list to add list to list.

John

#6 stan beck

stan beck

    Member

  • UBot Users
  • PipPip
  • 22 posts
  • OS:Windows 7
  • Total Memory:4Gb
  • Framework:v4.0
  • License:Standard

Posted 17 April 2012 - 07:07 AM

Change add item to list to add list to list.

John


Hi John,

Thanks for the response.

I don't quite understand. 'Add List to List' requires 2 lists, does it not? - I'm scraping urls from a page and adding them to a list.

When I put in the 'Add List to List', the only paramaters/options I have is a list (top and bottom) - I tried to put in a '$scrape attribute', but it's not taking it.

I must be missing something.

Thanks,

Stan

#7 stan beck

stan beck

    Member

  • UBot Users
  • PipPip
  • 22 posts
  • OS:Windows 7
  • Total Memory:4Gb
  • Framework:v4.0
  • License:Standard

Posted 17 April 2012 - 07:09 AM

Hi John,

Thanks for the response.

I don't quite understand. 'Add List to List' requires 2 lists, does it not? - I'm scraping urls from a page and adding them to a list.

When I put in the 'Add List to List', the only paramaters/options I have is a list (top and bottom) - I tried to put in a '$scrape attribute', but it's not taking it.

I must be missing something.

Thanks,

Stan


Nevermind, it's taking the scrape attribute afterall - not sure what I was doing before...

#8 JohnB

JohnB

    Advanced Member

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

Posted 17 April 2012 - 08:32 AM

Ok...it definitely works....whenever you use add item to list, even if you have 1000 items it treats them as a single item.


John




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users