Question Pushme.to message notification

IllusiveMan

New member
Joined
Feb 14, 2012
Messages
4
Programming Experience
3-5
I have been looking for a desktop messenger without the need to sign in and I found the perfect playing field for my self!.. though.. I've run into a major issue that I cannot comprehend..

here is the code..

VB.NET:
Private Sub PUSH_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PUSH.Click
        Dim uri = "http://www.pushme.to/" + PUSH.Text + "/" 'Buttons name is username
        Dim req As HttpWebRequest = CType(WebRequest.Create(uri), HttpWebRequest)
        req.SendChunked = True
        req.TransferEncoding = "gzip"
        Dim pdata As String = "presentedName=TEST_NAME&text=TEST+MESSAGE" 'Test Username/Message
        req.Method = "POST"
        Dim encoded As New ASCIIEncoding()
        Dim bytea As Byte() = encoded.GetBytes(pdata)
        req.ContentType = "application/x-www-form-urlencoded"
        req.ContentLength = bytea.Length
        Dim stream As Stream = req.GetRequestStream()
        stream.Write(bytea, 0, bytea.Length)
        stream.Close()
    End Sub

Basically I set the button as the user name to message and then post a test message.. but it will not post at all.

Please HELP! Thanks in advance!

Please help, I really need this!.

Edit:
I'm trying to mimic this... but in VB.Net
function pushMeTo($username, $message, $signature) { $curl = curl_init(); curl_setopt($curl, CURLOPT_URL, 'http://pushme.to/' . $username . '/'); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); curl_setopt($curl, CURLOPT_POST, true); curl_setopt($curl, CURLOPT_POSTFIELDS, 'message=' . urlencode($message) . '&signature=' . urlencode($signature)); curl_exec($curl); curl_close($curl); } pushMeTo('username', 'Hello world!', 'God');
 
Define "it will not post at all". What actually happens? That is always useful information when trying to diagnose an issue.

Breakpoint shows me it completes all of the above code, I get no errors when running the code.
but it does not show up on the website when i message my self.
 
Nothing happens server side when i press the button?

This bellow is what i'm trying to mimic....
Here is the POST headders recorded with Live HTTP Headders
----------------------------------------------------------------------
http://pushme.to/Elitism/

Method POST /Elitism/ HTTP/1.1
Host: pushme.to
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:12.0a2) Gecko/20120213 Firefox/12.0a2
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-gb,en;q=0.5
Accept-Encoding: gzip, deflate
Connection: keep-alive
Referer: http://pushme.to/Elitism/
Cookie: __utma=2312776.6570856.13225974.13290980.1329234470.3; __utmz=231277086.1329225974.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); __utmc=231277086; __utmb=231277086.1.10.1329234470; PHPSESSID=allq5e5gfdgetilngn52q6v4
Content-Type: application/x-www-form-urlencoded
Content-Length: 54
presentedName=THISISYOURNAME&text=THIS+IS+THE+MSSGTHATS+SENT+TO+ELITISM
Content-Type: text/html
Transfer-Encoding: chunked
Connection: keep-alive
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Set-Cookie: PHPSESSID=eie9k3prtmoqg44gk20aemvh2; expires=Wed, 13-Feb-2013 15:51:31 GMT; path=/
Location: /q/
----------------------------------------------------------------------


---

Here is a php widget which does the same thing i'm trying to mimic with .Net
--------------------------------------------------------------------------------------------
VB.NET:
<a href="http://pushme.to/" target="_blank"><img src="http://pushme.to/img/widget/bg_widget_logo.png" width="136" height="28" alt="" border="0"></img></a><br /><p >Send me an instant message!</p><form action="http://pushme.to/elitism/" method="POST"><input type="hidden" name="_encoding" value="UTF-8"> </input> Message:<br/><textarea name="message"> </textarea><br/><br/> Signature:<br/><input type="text" name="signature" value=""/><br/><br/><input type="submit" value=" Push "/></form>
--------------------------------------------------------------------------------------------
 
Last edited:
I've created an alternative.. but it's not rock solid
----------------------------------------------------------------------------
1: I created a resource inside my app which contains the php file
VB.NET:
<html>
<a href="http://pushme.to/" target="_blank"></a>
<form action="http://pushme.to/$send_to/" method="POST">
<input type="hidden" name="_encoding" value="UTF-8"/>
<input type="text" name="message" value="$cmsg"/>
<input type="text" name="signature" value="$cid"/>
<button name="submit" id="submit" type="submit">submit</button></form>
</html>
2: I then wrote some code which interacts with skype and sends user messages to pushme
VB.NET:
'Send Pushme Notifications
                    If pushme_to = True Then
                        Try
                            If last_message.Body.ToLower.Substring(0, 5) = "^push" Then
                                pushed_from = last_message.FromHandle
                                last_message.Chat.SendMessage("Please wait " + sender + ", Sending your message to " + oskype.CurrentUserProfile.FullName + "'s Mobile")
                                pushmephpcode = My.Resources.pushmetophp
                                pushmephpcode = pushmephpcode.Replace("$send_to", TextBox8.Text)
                                pushmephpcode = pushmephpcode.Replace("$cmsg", sender + ": " + last_message.Body.ToLower.Substring(6, last_message.Body.Length - 6))
                                pushmephpcode = pushmephpcode.Replace("$cid", My.User.Name)
                                WebBrowser1.DocumentText = pushmephpcode
                            End If
                        Catch ex As Exception
                        End Try
                    End If
3: I then wrote a simple web browser url check and replace code which will detect if the message was send by judging the original php resource string
VB.NET:
'Pushme_to submission
    Private Sub WebBrowser1_DocumentCompleted(ByVal sender As Object, ByVal e As System.Windows.Forms.WebBrowserDocumentCompletedEventArgs) Handles WebBrowser1.DocumentCompleted
        Dim stringx = WebBrowser1.Url.ToString
        If stringx = "about:blank" Then
            If pushmephpcode.Contains("$send_to") = True Then
                Exit Sub
            Else
                WebBrowser1.Document.GetElementById("submit").InvokeMember("click")
                oskype.SendMessage(pushed_from, "Your message has been sent to " + oskype.CurrentUserProfile.FullName)

            End If
        Else
            pushmephpcode = My.Resources.pushmetophp
            WebBrowser1.DocumentText = pushmephpcode
        End If
    End Sub

Even though this is not solid it is a work around and it does work for my needs but i require a solid POST method of the above if anyone is interested in the challenge! :)
 
Back
Top