?
Solved

Script to subscribe on websites

Posted on 2012-09-17
36
Medium Priority
?
405 Views
Last Modified: 2012-10-06
Hi Friends,

I have been assigned a task to subscribe approx 15k email ids to our website..

I mean I have to put these email ids into our website to forcefully subscribe for our newsletter, (although I know it is not correct way but I am bound to do so)

I have all emails in excel format,

Can anyone help/provide me such a scrip I can run from my pc, so all email ids get subscribed with in one click or two.

If possible kindly provide me the scrip with example (sorry i am very poor in scripting language)

Looking forwards your kind help & support,

thanks in advanced.
0
Comment
Question by:dxbdxb2009
  • 18
  • 14
  • 4
36 Comments
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 38404600
Do you have a url of the form to subscribe to?
Does your provider allow you to submit bulk (assuming a confirm email is generated)? If not, what is the limit per day/hour/minute?
0
 

Author Comment

by:dxbdxb2009
ID: 38404618
thanks for your prompt reply,

yes....it has the web link, embedded on it's homepage itself(right corner of home page)

kindly have a look on attached screen short & advice accordingly.

thanks in advanced..
homepage.jpg
0
 
LVL 38

Expert Comment

by:Gerwin Jansen, EE MVE
ID: 38404627
I would use a text based browser, for example Lynx, and create the URL's from your Excel list by concatenating the base URL and the email address.
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 38404633
HTA would be just as simple as Lynx

I was not asking for a screen shot, but asking for the HTML of the form itself.
If you want, you can remove the website from the action if it is a full URL
0
 

Author Comment

by:dxbdxb2009
ID: 38404650
Confused...!!!!

I just downloaded this http://lynx.isc.org/lynx2.8.7/lynx2.8.7.zip

How i can use & create text based browser & URL from Excel,

Would be great if you can just share one example file in-which i can add my email ids & run it....(sorry for dragging it...as i am a bit poor in scripting/languages)

hope you help & advice...

thanks in advance..
0
 

Author Comment

by:dxbdxb2009
ID: 38404831
anyone pls help...
0
 

Author Comment

by:dxbdxb2009
ID: 38404841
@ mplungjan : find the attached "HTML of the form"

however i am just attaching the homepage of the website,

kindly advice & help.
0
 
LVL 38

Expert Comment

by:Gerwin Jansen, EE MVE
ID: 38404842
in column A, something like this:

lynx http://your.site.com/subscribe?userid=

in column B:

your.user@addres.com

in column C, concatenate:

lynx http://your.site.com/subscribe?userid=your.user@addres.com

Now copy/paste all entries from column C to a batch file (.cmd) and let it run. Try with 1 or 2 URL's (or mail addresses).
0
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 38404866
No attachment
0
 

Author Comment

by:dxbdxb2009
ID: 38404937
@ mplungjan : sorry ...missed the attachment..

find it right away...
Online-Forex-Trading---Meta-Trad.htm
0
 

Author Comment

by:dxbdxb2009
ID: 38404941
@ mplungjan : sorry ...missed the attachment..

find it right away...

---------------------------------------------------------------------------------------------

@ gerwinjansen: it is giving error :
"'lynx' is not recognized as an internal or external command,
operable program or batch file."

Kindly advice if i am wrong anywhere...
0
 
LVL 38

Expert Comment

by:Gerwin Jansen, EE MVE
ID: 38404952
Either put lynx in the PATH or set it's location in the script, like this for example:

set LNXDIR=c:\temp
cd %LNXDIR%

%LNXDIR%\lynx http://someurl
0
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 38405130
I see a big issue

<input type="submit" id="submit" name="submit" value="Subscribe" style="" />

I am surprised your validation works at all:

$("form#contactForm").submit(function()

There should be a conflict
0
 

Author Comment

by:dxbdxb2009
ID: 38405160
@gerwinjansen: from cmd everything looks good...seems subscription done! but i can not see any email confirmation form our website...meaning ...it is not working..! pls advice..

--------------------------------------------------------------------------------------------------------------------------

@ mplungjan : If i put any email id on the page ... with in 20-30 secds i get confirmation email on my email id...

but using .cmd ...(which i just tried to create) done not work at all..

kindly advice any curable solution...
0
 

Author Comment

by:dxbdxb2009
ID: 38405335
anyone pls help...
0
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 38405343
Here is some code you can try

Save it as bulk.hta and run it from the windows explorer

You can paste the emails into the textarea with a crlf between each
Try a few first then see what happens with more. We may need a timeout between each and perhaps you can only do 1000 at a time in case IE crashes or some other limit

<!DOCTYPE html>
<html>
  <head>
  <meta http-equiv="content-type" content="text/html; charset=utf8-8">
  <title></title>
  <script>
  function show(str) {
    document.getElementById("message").innerHTML+=str+'<br/>';
  }
  function go() {
    var emails=document.getElementById("txt1").value.split("\r\n");
    var frm = document.getElementById("contactForm");
    var iframeDiv = document.getElementById("iframes");
    show('Processing '+emails.length+" emails");
    for (var i=0,n=emails.length;i<n;i++) {
      var iframeName = "ifr"+i;
      frm.target=iframeName;
      var ifr = document.createElement('<iframe name="'+iframeName+'"></iframe>');
      iframeDiv.appendChild(ifr);      

      frm.email1.value=emails[i];
      frm.submit();
    }
  }
  </script>
  </head>
  <body>
  <textarea id="txt1"></textarea>
  <input type="button" value=" GO " onclick="go()">
  <div id="message"></div>
  <div style="display:none">
    <!-- test form submitting to BING to see it work -->
   <!-- form action="http://bing.com/search" method="get" name="contactForm" id="contactForm">
 <input name="q" id="email1" type="text" size="19" /-->
  <!-- end of test form -->

 <form action="contact/send.php" method="post" name="contactForm" id="contactForm">
 Email: <input name="email1" id="email1" type="text" size="19" / >
 </form>
 </div>
<div id="iframes"></div>
 
  </body>
</html>

Open in new window

0
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 38405348
PS: Add

<style>
iframe { display:none }
</style>

if you do not want to see the iframes
0
 

Author Comment

by:dxbdxb2009
ID: 38405368
thanks for your help

do you mean this:
 <textarea id="txt1"></textarea>
  <textarea id="myemailid@somedomainname.com"></textarea>
0
 

Author Comment

by:dxbdxb2009
ID: 38405432
okay..i added my email id to test...
After pressing "Go" ....it is showing "Processing 1 emails" (see the attached screen-short)
however in bulk.hta i can not see my website name at all,
pls explain ...
* where i have to keep this bulk.hta file & open with windows explorer?
* do i have to put my website name anywhere in bulk.hta file?
* even waiting for more then 5 mitns bulk.hta is showing "Processing 1 emails" & i did not receive any confirmation email...at all
kindly advice...
Processing-1-email.jpg
0
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 38405601
You need to change

action="contact/send.php"

to

action="http://www.nameofyourserver.com/contact/send.php"

where nameofyourserver.com is your website

Then paste emails into the textarea. No need to change anything else in the html
0
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 38405610
and you can change
      frm.email1.value=emails[i];
      frm.submit();

Open in new window

to
      frm.email1.value=emails[i];
      show('Processing '+emails[i]);
      frm.submit();

Open in new window

0
 
LVL 38

Expert Comment

by:Gerwin Jansen, EE MVE
ID: 38405611
>> meaning ...it is not working..! pls advice..

How is your URL looking?
0
 

Author Comment

by:dxbdxb2009
ID: 38405682
@ mplungjan : still showing "Processing 1 emails" however i can not get any confirmation on my email id.....

pls help any curable solution..

thanks
0
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 38405858
I cannot help unless you show or send me the code you implemented
It works for me.
Perhaps your server needs the referrer set - if that is the case then you need to host my script as a normal HTML page on the same server as the form.
Actually thinking about this I think using HTA is not even necessary since we only load the form result and we do not try to access the content of the iframe
0
 

Author Comment

by:dxbdxb2009
ID: 38405938
OKAY ...this is what i done:- (see the attached here with-also remove  .zip to see bulk.hta)
bulk.hta.zip
0
 

Author Comment

by:dxbdxb2009
ID: 38406013
just leaving for the day... catch you tomorrow...

if possible pls share any curable solution/file which can solve my issue.

many thanks in advanced..
0
 
LVL 75

Accepted Solution

by:
Michel Plungjan earned 1000 total points
ID: 38406324
Your form does not return any result when I submit to it directly

Here is a new version you can save as html and run from IE or Firefox (not tested in IE this time)

<!DOCTYPE html>
<html>
  <head>
  <meta http-equiv="content-type" content="text/html; charset=utf-8">
  <title></title>
                                           
<style>
iframe { display:block }
</style>
  <script>
  var isIE = /*@cc_on!@*/false;
  var delim=isIE?"\r\n":"\n";
  function show(str) {
    document.getElementById("message").innerHTML+=str+'<br/>';
  }
  function go() {
    var emails=document.getElementById("txt1").value.split(delim);
    var frm = document.getElementById("contactForm");
    var iframeDiv = document.getElementById("iframes");
    show('Processing '+emails.length+" email"+(emails.length==1?'':'s'));
    if (emails.length>10) { 
      iframeDiv.style.display='none'; 
      show("Not showing each result due to number of emails > 10");
    }
    for (var i=0,n=emails.length;i<n;i++) {
      if(emails[i]=="") { show("Line "+(i+1)+" was empty, ignored"); continue }
      var iframeName = "ifr"+i;
      frm.target=iframeName;
      var iframeText = isIE?'<iframe name="'+iframeName+'"></iframe>':'iframe';
      var ifr = document.createElement(iframeText);
      if (!isIE) ifr.name=iframeName;
      iframeDiv.appendChild(ifr);      
      show(emails[i]);
      frm.email1.value=emails[i];
      frm.submit();
    }
    show("Processing complete");
  }
  </script>
  </head>
  <body>
  <textarea id="txt1" placeholder="Paste your list here"></textarea>
  <input type="button" value=" GO " onclick="go()">
  <div id="message"></div>
  <div style="display:none">
    <!-- test form submitting to BING to see it work -->
   <!-- form action="http://bing.com/search" method="get" name="contactForm" id="contactForm">
 <input name="q" id="email1" type="text" size="19" /-->
  <!-- end of test form -->

 <form target="_blank" action="http://www.sevenstarfx.com/contact/send.php" method="post" name="contactForm" id="contactForm">
 Email: <input name="email1" id="email1" type="text" size="19" / >
 </form>
 </div>
<div id="iframes"></div>
 
  </body>
</html>
 

Open in new window

0
 

Author Comment

by:dxbdxb2009
ID: 38408455
@ mplungjan : -

it is showing "Processing complete" but i did not get any confirmation email on my email id which i put in as here:-
 <textarea id="txt1" placeholder="Paste your list here">myemailid@gmail.com</textarea>

pls advice is it working at your end....?
0
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 38408460
It works on the client. You need to look in the server logs to see if there is an error message
0
 

Author Comment

by:dxbdxb2009
ID: 38408470
@ mplungjan
=on the client.=?
did i entered my email id at correct place?
do i have to use any other software to open this test.html page instead of IE or Mozilla?
i am sorry I do not have access to server logs, as what all we can confirm it just either we receive confirmation email or not,

another way to accomplish the task ... would be great,

kindly advice & help.

many thanks in advance...
0
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 38408836
1) yes you entered in the right place
2) no - you need to make sure the server understands and allows the request. The code I gave you works - it is now  a server problem.

If it is not your server then you will likely not be able to do what you want unless you fake the referrer
0
 

Author Comment

by:dxbdxb2009
ID: 38409276
helpless...!!!

pls advice any other way to get it done...else i will accept as solution & close it down..

many thanks once again..
0
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 38409443
Use CURL for PHP on your server and set the CURLOPT_REFERER  to the site of the signup

I do not know how to do this in VB.NET
0
 

Author Comment

by:dxbdxb2009
ID: 38409769
as said i have no access on server...even will contact web master ....will update you soon..
thanks
0
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 38409854
I REPEAT:  Use curl on YOUR server to access THEIR server from YOUR server with the referer set to see if that helps
0
 

Author Comment

by:dxbdxb2009
ID: 38456006
surely ...will try the day after tomorrow ....& shell come back..

thanks...
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Finding original email is quite difficult due to their duplicates. From this article, you will come to know why multiple duplicates of same emails appear and how to delete duplicate emails from Outlook securely and instantly while vital emails remai…
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses
Course of the Month15 days, 22 hours left to enroll

850 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