iMacros, — October 31, 2009 — 1 Comment

iMacros Select Random Datasource Line

closeThis post was published 2 years 6 months 21 days ago. In SEO, things change quickly and this advice might be out of date. Just wanted to let you know before acting on the advice. :)

If you’re like me, you want things to be as random as possible, this means selecting just about everything from a CSV or database. If you want to select a random line from your datasource, just create as many columns you need and use this code.


URL GOTO=http://www.graphpad.com/quickcalcs/randomN1.cfm
TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:CFForm_1 ATTR=ID:low CONTENT=1
TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:CFForm_1 ATTR=ID:hi CONTENT=10
TAG POS=1 TYPE=INPUT:SUBMIT FORM=NAME:CFForm_1 ATTR=NAME:Random
TAG POS=18 TYPE=TD ATTR=TXT:* EXTRACT=TXT
'
SET !VAR1 {{!EXTRACT}}
'
CMDLINE !DATASOURCE datasource.csv
SET !DATASOURCE_COLUMNS 1
SET !DATASOURCE_LINE {{!VAR1}}

The last three lines are what choose the random line in your CSV. Line 2 sets the low range and line 3 sets the high range of your random choice, so if you have a datasource with 55 lines, set the following.

TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:CFForm_1 ATTR=ID:hi CONTENT=10

Hope that helps you use iMacros in a better and more random way!

Related posts:

  1. iMacros Random Number Variable
  2. Add Line Breaks in WordPress Posts

About Brandon Hopkins

I'm a professional link builder with a team of full time link builders and clients around the world. Contact me as soon as you're ready to rank #1. This post was written by .

One Comment

  1. very helphul POST, thanks.

    didn’t know i could get random #s with imacro

Leave a Reply

Recent News