Advertisement
Guest User

Untitled

a guest
Mar 20th, 2015
282
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.62 KB | None | 0 0
  1. get 'deviceadmin' => sub {
  2. my $c = shift;
  3.  
  4. my $ua = Mojo::UserAgent->new;
  5.  
  6. app->log->debug('IOLOOP: ' . (Mojo::IOLoop->is_running ? 1 : 0));
  7.  
  8. my $headers = { Authorization => 'key=A' };
  9.  
  10. my $payload = encode_json { android => {alert => 'alerthere', badge => '+2', title => 'titlehere', tickerText => 'foo bar long crap here blah blah blah' },
  11. token => 1234,
  12. msgtype => 1};
  13.  
  14. my $tx = $ua->build_tx(POST => 'https://android.googleapis.com/gcm/send' => $headers =>
  15. form => { registration_id => 'AP',
  16. collapse_key => 'foo',
  17. 'data.payload' => $payload } );
  18. $tx = $ua->start($tx => sub{});
  19. Mojo::IOLoop->start unless Mojo::IOLoop->is_running;
  20.  
  21. }; # deviceadmin
  22.  
  23.  
  24.  
  25.  
  26.  
  27. [Sat Mar 21 03:32:06 2015] [debug] GET "/app/deviceadmin"
  28. [Sat Mar 21 03:32:06 2015] [debug] Routing to a callback
  29. [Sat Mar 21 03:32:06 2015] [debug] Routing to a callback
  30. [Sat Mar 21 03:32:06 2015] [debug] Routing to a callback
  31. [Sat Mar 21 03:32:06 2015] [debug] IOLOOP: 1
  32. -- Non-blocking request (https://android.googleapis.com/gcm/send)
  33. -- Connect 9067e56496aa7cf30f0caa4f900060ec (https://android.googleapis.com:443)
  34. [Sat Mar 21 03:32:06 2015] [debug] Rendering template "deviceadmin.html.ep" from DATA section
  35. [Sat Mar 21 03:32:06 2015] [debug] Rendering template "layouts/bootstrap.html.ep" from DATA section
  36. [Sat Mar 21 03:32:06 2015] [debug] 200 OK (0.007120s, 140.449/s)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement