Solved

# URL Rotator With Weighted Email Sending Capability

Posted on 2007-09-28
212 Views
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.
0
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?
0

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.

0

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?
0

Author Comment

Ozo

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.
0

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

--
Lee
0

LVL 84

Accepted Solution

@shares=(
);

\$longrun=100;

my \$t=0;
my \$member;
for( @shares ){
\$member = \$_ if rand(\$t+=\$p)<\$p;
}
print "send to \$member->{name}\n";

}
0

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.
0

## Featured Post

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…