andymurray 2 Posted May 17, 2013 Report Share Posted May 17, 2013 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 tochange the publishing date, the interface appears andquickly disappears back to the 'edit' link again. What I'm trying to do is post a folder full of articles oneby one, with a staggered publish date for each. The first one will be immediately, then the seconda day or two later, and so on... Any help is great appreciated. Thanks,Andy Quote Link to post Share on other sites
nuc63 27 Posted May 17, 2013 Report Share Posted May 17, 2013 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? Quote Link to post Share on other sites
andymurray 2 Posted May 17, 2013 Author Report Share Posted May 17, 2013 Thanks I'll give it a whirl. I'm just using the browserthat comes stock with Ubot. How do I disable those things? Thanks,Andy Quote Link to post Share on other sites
andymurray 2 Posted May 17, 2013 Author Report Share Posted May 17, 2013 I'm struggling with this. Could you take a look at this code for me and tell mewhats 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 ----------------------------->")dividerui 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 thethe processing of each post, but Ubot went crazy and keptpopping up 'you have exceeded the list' error. Took me agesto delete the node Thanks,Andy Quote Link to post Share on other sites
nuc63 27 Posted May 17, 2013 Report Share Posted May 17, 2013 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. Quote Link to post Share on other sites
andymurray 2 Posted May 17, 2013 Author Report Share Posted May 17, 2013 Thanks! Its getting really late in the day here, could you possibly tellme where I paste this code within my script. I see that you'vekind of streamlined what I did. Just can't figure out how toimplement it. Andy Quote Link to post Share on other sites
nuc63 27 Posted May 18, 2013 Report Share Posted May 18, 2013 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 1 Quote Link to post Share on other sites
andymurray 2 Posted May 18, 2013 Author Report Share Posted May 18, 2013 You are a star! Thank you very much. This was the last piece ofmy bot I'd been working on. Left it till last becauseif I tried to tackle it first I would have given up So much appreciated. Andy Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.