Results 1 to 9 of 9
  1. #1
    Member
    Join Date
    October 10th, 2006
    Posts
    155
    Inserting random numbers?
    I'm playing with the demo of webmerge. I need to insert a series of random number...is there a template tag to do this?

    If not, is there a solution other than just making each page php and inserting code to do that for each page? I'd rather have static html.

    I'm using the OS X version of webmerge...perhaps some way to do this with applescript or something?

  2. #2
    Affiliate Manager
    Join Date
    January 18th, 2005
    Location
    Los Angeles, California
    Posts
    1,913
    Hmmm....this is a very interesting request. First time we've had a request for a random number. Is it just a number you need, or a random record, or something else?

    If it's just a number it would be dirt simple for me to add something like a WM-Random tag.

    Would you also need to reset the random seed?
    Richard Gaskin
    Developer of WebMerge: Publish any data feed on any site
    http://www.fourthworld.com

  3. #3
    Member
    Join Date
    October 10th, 2006
    Posts
    155
    What I need is a WM-Random tag that makes sure it doesn't insert a duplicate of the other instances of WM-Random on the page.

    So really, it's more like shuffling a group of numbers than merely inserting random numbers.

    In other words...let's say I wanted the numbers 1 through 100 displayed somewhere on a page but in random order. So 3, 27, 91, 82, 64, and so on.

    Would my best bet be to generate the pages, and then use an Applescript-enabled app like Textmate/BBEdit to insert them?

  4. #4
    Affiliate Manager
    Join Date
    January 18th, 2005
    Location
    Los Angeles, California
    Posts
    1,913
    Can you describe how it will be used?

    A simple WM-Random tag would be easy, but of courase random numbers may repeat in sequence, so a non-repeating random series is a different animal.

    We should also consider range.

    Knowing the specifics of how you envision using this would help me explore options for an implementation which would be truly useful.
    Richard Gaskin
    Developer of WebMerge: Publish any data feed on any site
    http://www.fourthworld.com

  5. #5
    Member
    Join Date
    October 10th, 2006
    Posts
    155
    Quote Originally Posted by FourthWorld
    Can you describe how it will be used?

    A simple WM-Random tag would be easy, but of courase random numbers may repeat in sequence, so a non-repeating random series is a different animal.

    We should also consider range.

    Knowing the specifics of how you envision using this would help me explore options for an implementation which would be truly useful.
    Say I had a page where I had three testimonials:

    "I saved $[WM-RandomNoRepeat]range=200-500[/WM-RandomNoRepeat] thanks to lulavsfakesite.com!"

    "Thanks lulavsfakesite.com, we were able to save $[WM-RandomNoRepeat]range=51-900[/WM-RandomNoRepeat]!"

    "We love lulavsfakesite.com...it's truly amazing that you can save $[WM-RandomNoRepeat]range=200-500[/WM-RandomNoRepeat] on [WM-Field: Productname]!"

    and so on. That's the basic idea...except it's way more than 3 testimonials/comments/posts for this project. And it would also be nice to just say "Our members saved an average of $[WM-RandomNoRepeat]range=81-922[/WM-RandomNoRepeat] on [WM-Field: Productname]!" ...this way the amount changes each *page* and is specific to that page's product.

    I don't want the values to change each time the surfer visits the page...that's why I want static html. It would be easy to generate a random number that's different every time in PHP. Too much hassle to store all the values in mysql and look them up for something this basic with tons of values.

    Come to think of it, I could just create a CSV full of random numbers based on the fields I want, and then make that a WM-Field. Except for this project, I'd have to modify the original CSV...I don't think Webmerge can accept input from two CSV's? Can it? Because I probably could just add the random numbers in excel how I want them.

  6. #6
    Affiliate Manager
    Join Date
    January 18th, 2005
    Location
    Los Angeles, California
    Posts
    1,913
    If these are actual testimonials why would the amount change?
    Richard Gaskin
    Developer of WebMerge: Publish any data feed on any site
    http://www.fourthworld.com

  7. #7
    Member
    Join Date
    October 10th, 2006
    Posts
    155
    Quote Originally Posted by FourthWorld
    If these are actual testimonials why would the amount change?
    They wouldn't be actual testimonials, just like every other testimonial on the internet. It was an example.

  8. #8
    Affiliate Manager
    Join Date
    January 18th, 2005
    Location
    Los Angeles, California
    Posts
    1,913
    FWIW, all of the testimonials on our Gallery page and elsewhere across our site are actual comments people have sent us:
    http://www.fourthworld.com/products/...e/gallery.html
    Richard Gaskin
    Developer of WebMerge: Publish any data feed on any site
    http://www.fourthworld.com

  9. #9
    Newbie
    Join Date
    November 11th, 2009
    Posts
    2
    I would also like to see a random number generator with a range option in Webmerge (f.e. [WM-RANDOM 100:500] would return a random number from 100 to 500). It would help so as to make the pages created more "unique" in several cases.

    It would also be interesting if there was another tag that would randomly select and display a field(s) from a feed (f.e. [WM-RANDOMFIELD field1,field2,field3] would randomly select one of the 3 fields and display its content). Again this will help for the uniqueness of the page.

  10. Newsletter Signup

+ Reply to Thread

Similar Threads

  1. Help inserting affiliate links
    By BrandynIce in forum Newbie Affiliate FAQs & Helpful Articles
    Replies: 9
    Last Post: February 8th, 2013, 06:48 AM
  2. Discrepancy: Google Numbers vs. ShareASale Numbers
    By shocker in forum ShareASale - SAS
    Replies: 1
    Last Post: April 24th, 2011, 06:58 PM
  3. WM-IndexLabel and inserting blanks
    By adamxcl in forum WebMerge (Fourthworld.com)
    Replies: 2
    Last Post: October 7th, 2009, 01:58 PM
  4. Inserting text into db
    By jackson992 in forum Programming / Datafeeds / Tools
    Replies: 2
    Last Post: December 19th, 2005, 10:12 PM
  5. Inserting data into templates
    By forefront in forum Cusimano.com Scripts
    Replies: 1
    Last Post: February 20th, 2005, 12:18 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •