Jump to content
UBot Underground

How to change the publishing date of wordpress post?


Recommended Posts

Hello,

 

I did a search but couldn't find the answer.

 

Does anybody know how to do this?

 

The problem I am facing is when I click the 'edit' link to

change the publishing date, the interface appears and

quickly disappears back to the 'edit' link again.

 

What I'm trying to do is post a folder full of articles one

by one, with a staggered publish date for each.

 

The first one will be immediately, then the second

a day or two later, and so on...

 

Any help is great appreciated.

 

Thanks,

Andy

Link to post
Share on other sites
click(<outerhtml="<a href=\"#edit_timestamp\" class=\"edit-timestamp hide-if-no-js\" style=\"display: inline; \">Edit</a>">, "Left Click", "No")
wait for element(<innertext="OK Cancel">, 30, "Appear")
change dropdown(<name="mm">, "Random")
change attribute(<name="jj">, "value", 1)

This was done with default browser.

 

 

if this does not work what browser are you using?

have you disabled java,flash,css,popups in your bot as well?

Link to post
Share on other sites

I'm struggling with this.

 

Could you take a look at this code for me and tell me

whats wrong:

 

 comment("<----- Article Post Start ------------------------------>")
add list to list(%MSArticles$list from text($get files("{$special folder("Application")}\\{#MSArticlesLocation}""No"), "
"), "Delete""Global")
wait for element(<innertext="Posts">"""Appear")
click(<href="edit.php">"Left Click""No")
wait for element(<title="Edit “Hello world!”">"""Appear")
click(<title="Move this item to the Trash">"Left Click""No")
wait for element(<class="add-new-h2">"""Appear")
click(<class="add-new-h2">"Left Click""No")
wait for element(<id="show-settings-link">"""Appear")
click(<id="show-settings-link">"Left Click""No")
wait for element(<name="commentstatusdiv-hide">"""Appear")
change checkbox(<name="commentstatusdiv-hide">"Checked")
change checkbox(<name="comment_status">"Unchecked")
loop($list total(%MSArticles)) {
    set(#MSArticles$next list item(%MSArticles), "Global")
    wait for element(<class="add-new-h2">"""Appear")
    click(<class="add-new-h2">"Left Click""No")
    wait for element(<id="publish">"""Appear")
    type text(<name="post_title">$substring(#MSArticles, 0, $find index(#MSArticles".")), "Standard")
    set(#MSArticleContent$read file(#MSArticles), "Global")
    type text(<name="content">#MSArticleContent"Standard")
    click(<name="publish">"Left Click""No")
}
comment("<----- Article Post Finish ----------------------------->")
divider
ui text box("Articles Location:"#MSArticlesLocation)
ui stat monitor("Articles found:"$list total(%MSArticles))

 

I tried to add a stat monitor to the bottom that tracks the

the processing of each post, but Ubot went crazy and kept

popping up 'you have exceeded the list' error. Took me ages

to delete the node :)

 

Thanks,

Andy

Link to post
Share on other sites
wait for element(<name="commentstatusdiv-hide">, 15, "Appear")
set(#position, 0, "Global")
loop($list total(%MSArticles)) {
    set(#MSArticlescontent, $list from file("{$special folder("Application")}\\{#MSArticlesLocation}\\{$list item(%MSArticles, #position)}"), "Global")
    type text(<name="content">, #MSArticleContent, "Standard")
    increment(#position)
}

ui text box("Articles Location:", #MSArticlesLocation)

 

The 15 is advanced setting of wait for element and sets a timeout. This is important to set or it waits forever.

 

using #position will allow greater control next list item does not always work well.

Link to post
Share on other sites

Thanks!

 

Its getting really late in the day here, could you possibly tell

me where I paste this code within my script. I see that you've

kind of streamlined what I did. Just can't figure out how to

implement it.

 

Andy 

Link to post
Share on other sites
ui text box("Articles Location:", #MSArticlesLocation)
clear list(%MSArticles)
add list to list(%MSArticles, $list from text($get files("{$special folder("Application")}\\{#MSArticlesLocation}", "No"), "
"), "Delete", "Global")
set(#position, 0, "Global")
loop($list total(%MSArticles)) {
    set(#MSArticlescontent, $list from file("{$special folder("Application")}\\{#MSArticlesLocation}\\{$list item(%MSArticles, #position)}"), "Global")
    wait(1)
    click(<href="post-new.php">, "Left Click", "No")
    wait for element(<innertext="Add New Post">, 15, "Appear")
    set(#title, $replace($list item(%MSArticles, #position), ".txt", $nothing), "Global")
    type text(<name="post_title">, #title, "Standard")
    type text($element offset(<tagname="html">, 1), #MSArticlescontent, "Standard")
    click(<name="publish">, "Left Click", "No")
    increment(#position)
}

login to wordpress site and then run code

  • Like 1
Link to post
Share on other sites

You are a star!

 

Thank you very much. This was the last piece of

my bot I'd been working on. Left it till last because

if I tried to tackle it first I would have given up :)

 

So much appreciated.

 

Andy

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...