URL Rotator With Weighted Email Sending Capability

Posted on 2007-09-28
Last Modified: 2013-12-25
I want to capture contact information and then send it to members of a co-op based on how many shares they have purchased.  In other words I want to send people off of a radio ad to one URL and then have the people in the co-op immediately get the contact information and If I got 10 shares in the co-op, not only do I get the leads based on my shares, but  I want to make sure that everyone is sent the contacts that they paid for and no one is left out.  
Question by:4ubest
    LVL 84

    Expert Comment

    I'm not sure I understand what you are asking.
    Could you give some examples of what you want to happen in what situations?

    Author Comment

    Selling shares.. of leads that will be generated from Radio/TV ads.   If I buy 5 shares and several buy 1 share and some buy 3 shares... I want the leads that are being sent to a specific URL to be distributed so that everyone gets their order  all the 1, 3 , 5..     Previously I had done this by just giving the persons with multiple shares  multiple email addresses...  I want to distribute the leads that are generated fairly and accurately.

    LVL 84

    Expert Comment

    Do you mean that if there are 9 leads, you want to get 5 of them of them, someone else to get 3 of them, and the other person to get 1 of them?
    Do you want it to be random which leads go where, or should it follow a specific schedule?
    Do you need to have the distribution as close to fair as possible after each lead? or should it even out over the long run?

    Author Comment


    Yes to your first statement, random with it even out over the long run for the duration of the co-op which would be until everyone got the leads they paid for.
    LVL 16

    Expert Comment

    If random is acceptable, I'd use the cumulative probability:  Assuming you have 5, 3 & 1 from your example, you have a total of 9.  Therefore you generate a random number between 1 and 9, and if:

    1..5 : person a.
    6..8 : person b.
    9     : person c

    LVL 84

    Accepted Solution

    {name=>'I', bought=>5, leads=>0},
    {name=>'several', bought=>1, leads=>0},
    {name=>'some', bought=>3, leads=>0},


    sub sendlead{
        my $t=0;
        my $member;
        for( @shares ){
            my $p = $_->{bought}*($_->{bought}/(1+$_->{leads})+$longrun);
            $member = $_ if rand($t+=$p)<$p;
        print "send to $member->{name}\n";


    Author Comment

    Thank you ozo  but the numbers I gave were hypothetical ..  What language is this ?

       I was looking at  commercial URL rotators that would  be able to distribute these leads automatically to as many different email addresses as there are participants in the co-op.  

    Featured Post

    Highfive Gives IT Their Time Back

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
    Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
    Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
    This tutorial demonstrates how to identify and create boundary or building outlines in Google Maps. In this example, I outline the boundaries of an enclosed skatepark within a community park.  Login to your Google Account, then  Google for "Google M…

    734 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now