Results 1 to 2 of 2

Thread: Submit form data to multiple Twitter users

  1. #1
    Join Date
    May 2008
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Submit form data to multiple Twitter users

    I had to create a search form for a database containing my boss's Twitter "followers". He wants to send them notices based on the results of the search criteria. In other words if someone mentioned needing a housecleaner and you searched for the word "housecleaner" all the posts and the users who posted them will come up. He then wants to send just those people a message.

    I've got it all sorted, but I have one problem. The message has to be submitted using "post", so I have to put it in a form. Once the form is triggered the first time I'm taken away from my script, to the Twitter site.

    How can I have the form submit while staying on my script page, so that it can loop and send the message to the next person, and the next, etc?

    Here is the relevent part of my code. This works, but as I said, after sending the first post, it leaves the page.
    Code:
    Do While Not rs.EOF
    iID = rs("ID") + 1
    sTweet = rs("tbl_Tweet")
    set rs1 = con2.Execute("SELECT [ID], [tbl_Tweeter] FROM twitter_chat WHERE [ID]=" & iID)
    sTweeter = rs1("tbl_Tweeter")
    sTweetertwo = Replace(sTweeter, "by ", "")
    MyArray = Split(sTweetertwo, " ")
    sTweeterthree = MyArray(0)
    sComment = "@" & sTweeterthree & " " & rMessage
    %>
    <form name="tweetSubmit" action="http://twitter.com/statuses/update....us=<%=sComment%>" method="post">
    <input type="hidden" name="twitter_username" value="my_username" />
    <input type="hidden" name="twitter_psw" value="my_password" />
    </form>
    <SCRIPT LANGUAGE="JavaScript">
     document.tweetSubmit.submit();
    </SCRIPT>
    <%
    	rs.MoveNext
    	Loop
    	Response.Write "</table>"
      End If   
       rs.Close
       set rs = Nothing
       rs1.Close
       set rs1 = Nothing
       con2.Close
       set con2 = Nothing
    EDIT: I added target=_new to my form so now it opens the action page in a new window and submits the data, and the rest of the script loops and prints out all of the relevent posts, but the form submittal only works that first time around the loop. Any ideas? I'm trying a 5 second pause in the script, maybe that will help. If not any ideas would appreciated.
    Last edited by Snookerman; 06-10-2009 at 06:39 PM.

  2. #2
    Join Date
    May 2008
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Nevermind, got it. Used http_referrer.

Bookmarks

Posting Permissions

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