Advertisement
Guest User

Untitled

a guest
Mar 20th, 2015
268
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. get 'deviceadmin' => sub {
  2. my $c = shift;
  3.  
  4. my $ua = Mojo::UserAgent->new;
  5.  
  6. my $headers = { Authorization => 'key=A' };
  7.  
  8. my $payload = encode_json { android => {alert => 'alerthere', badge => '+2', title => 'titlehere', tickerText => 'foo bar long crap here blah blah blah' },
  9. token => 1234,
  10. msgtype => 1};
  11.  
  12. my $tx = $ua->post('https://android.googleapis.com/gcm/send' => $headers =>
  13. form => { registration_id => 'AP',
  14. collapse_key => 'foo',
  15. 'data.payload' => $payload } => sub{ $ua } );
  16.  
  17. }; # deviceadmin
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement