Automatic Posting my articles...

Support for iMacros. The iMacros software is the unique solution for automating every activity inside a web browser, for data extraction and web testing.
Forum rules
Before asking a question or reporting an issue:
1. Please review the list of FAQ's.
2. Use the search box (at the top of each forum page) to see if a similar problem or question has already been addressed.
3. Try searching the iMacros Wiki - it contains the complete iMacros reference as well as plenty of samples and tutorials.
4. We can respond much faster to your posts if you include the following information: CLICK HERE FOR IMPORTANT INFORMATION TO INCLUDE IN YOUR POST
Post Reply
newmacro
Posts: 2
Joined: Fri Sep 03, 2010 11:53 am

Automatic Posting my articles...

Post by newmacro » Sat Sep 04, 2010 4:30 pm

So I have a list of websites that I want to post different articles each. It doesnt' matter where each article goes, as long as they are posted. All the websites are similar so I would rather use one macro to get it all done.

Code: Select all

VERSION BUILD=6700624 RECORDER=FX
TAB CLOSEALLOTHERS
SET !DATASOURCE websites.csv
SET !DATASOURCE_COLUMNS 1
SET !DATASOURCE_LINE {{!LOOP}} 
URL GOTO={{!COL1}}login/
TAG POS=1 TYPE=INPUT:TEXT FORM=ACTION:* ATTR=NAME:username CONTENT=username
SET !ENCRYPTION NO
TAG POS=1 TYPE=INPUT:PASSWORD FORM=ACTION:* ATTR=NAME:password CONTENT=password
TAG POS=1 TYPE=INPUT:SUBMIT FORM=ID:member_login_form ATTR=VALUE:Submit

Code: Select all

URL GOTO={{!COL1}}submit_article/
SET !DATASOURCE /articles/
TAG POS=1 TYPE=TEXTAREA FORM=ACTION:* ATTR=NAME:bio CONTENT={{!COL1}}
TAG POS=1 TYPE=INPUT:SUBMIT FORM=ACTION:* ATTR=VALUE:Update
The first part - login etc. - works great but then it hits problems..

I need to load the second script after the first one is done - how is this done? This is because the use of two datasources in one script isn't possible.

The second thing is how can I use the macro to load up the first article in my /articles/ directory that is in .txt format and copy+paste everything inside the txt to the text area. After that it should delete the .txt from the /articles/ directory.
Tom, Tech Support
Posts: 3513
Joined: Mon May 31, 2010 4:59 pm

Re: Automatic Posting my articles...

Post by Tom, Tech Support » Thu Sep 09, 2010 5:49 pm

Hi newmacro,

Here's a way to do it with one macro:

Code: Select all

VERSION BUILD=6700624 RECORDER=FX
TAB CLOSEALLOTHERS
TAB T=1
SET !DATASOURCE websites.csv
SET !DATASOURCE_COLUMNS 1
SET !DATASOURCE_LINE {{!LOOP}}
URL GOTO={{!COL1}}login/
TAG POS=1 TYPE=INPUT:TEXT FORM=ACTION:* ATTR=NAME:username CONTENT=username
SET !ENCRYPTION NO
TAG POS=1 TYPE=INPUT:PASSWORD FORM=ACTION:* ATTR=NAME:password CONTENT=password
TAG POS=1 TYPE=INPUT:SUBMIT FORM=ID:member_login_form ATTR=VALUE:Submit

' Open the article file in a new tab and extract all the text
TAB OPEN
TAB T=2
URL GOTO=file:///C:/Articles/Article_{{!LOOP}}.txt
TAG POS=1 TYPE=HTML ATTR=* EXTRACT=TXT
TAB CLOSE

' Switch back to the main tab and post the extracted text
TAB T=1
URL GOTO={{!COL1}}submit_article/
TAG POS=1 TYPE=TEXTAREA FORM=ACTION:* ATTR=NAME:bio CONTENT={{!EXTRACT}}
TAG POS=1 TYPE=INPUT:SUBMIT FORM=ACTION:* ATTR=VALUE:Update
For this to work, you would name your article files Article_1.txt, Article_2.txt, Article_3.txt, etc.
Regards,

Tom, iMacros Support
Post Reply