pushbullet 푸시 발송

· 10년 전 · 796

api가 쉽게 되어있어 급하게 만들어 보았습니다.

 

 

# pushbullet.class.php
[code]

<?php

class oh_push {

 

var $token_key;

var $push_url = 'https://api.pushbullet.com/v2/pushes';

 

public function __construct($token_key) {

$this->token_key = $token_key;

}

 

public function token() {

return $this->token_key;

}

 

public function send($email=array(), $body='', $title='') {

 

$type = 'note';

foreach($email as $k=>$v) {

 

$push_param = 'type='.$type.'&email='.$v.'&title='.$title.'&body='.$body;

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, $this->push_url);

curl_setopt($ch, CURLOPT_POST, true);

curl_setopt($ch, CURLOPT_POSTFIELDS, $push_param);

curl_setopt($ch, CURLOPT_HTTPHEADER, array('Access-Token: '.$this->token_key));

curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$response = curl_exec($ch);

curl_close($ch);

}

}

}

 

$oh_push = new oh_push('토큰키');

$oh_push->send(array('이메일'), '내용', '제목');

[/code]

 

 

토큰은 푸시불렛의 셋팅에서 받을수 있습니다.

|
댓글을 작성하시려면 로그인이 필요합니다. 로그인

프로그램

+
제목 글쓴이 날짜 조회
9년 전 조회 497
9년 전 조회 419
9년 전 조회 538
9년 전 조회 467
9년 전 조회 409
9년 전 조회 369
9년 전 조회 417
9년 전 조회 364
9년 전 조회 400
9년 전 조회 431
9년 전 조회 369
10년 전 조회 412
10년 전 조회 380
10년 전 조회 487
10년 전 조회 578
10년 전 조회 537
10년 전 조회 492
10년 전 조회 423
10년 전 조회 509
10년 전 조회 427
10년 전 조회 456
10년 전 조회 412
10년 전 조회 383
10년 전 조회 387
10년 전 조회 425
10년 전 조회 486
10년 전 조회 443
10년 전 조회 501
10년 전 조회 423
10년 전 조회 440
10년 전 조회 428
10년 전 조회 472
10년 전 조회 564
10년 전 조회 655
10년 전 조회 434
10년 전 조회 502
10년 전 조회 428
10년 전 조회 357
10년 전 조회 362
10년 전 조회 541
10년 전 조회 431
10년 전 조회 410
10년 전 조회 407
10년 전 조회 557
10년 전 조회 557
10년 전 조회 1,079
10년 전 조회 465
10년 전 조회 534
10년 전 조회 439
10년 전 조회 797
10년 전 조회 515
10년 전 조회 504
10년 전 조회 473
10년 전 조회 425
10년 전 조회 666
10년 전 조회 570
10년 전 조회 393
10년 전 조회 490
10년 전 조회 615
10년 전 조회 344
10년 전 조회 402
10년 전 조회 403
10년 전 조회 841
10년 전 조회 522
10년 전 조회 530
10년 전 조회 557
10년 전 조회 534
10년 전 조회 761
10년 전 조회 626
10년 전 조회 572
10년 전 조회 575
10년 전 조회 568
10년 전 조회 553
10년 전 조회 487
10년 전 조회 964
10년 전 조회 471
10년 전 조회 492
10년 전 조회 713
10년 전 조회 498
10년 전 조회 557
10년 전 조회 413
10년 전 조회 680
10년 전 조회 502
10년 전 조회 438
10년 전 조회 441
10년 전 조회 1,134
10년 전 조회 510
10년 전 조회 501
10년 전 조회 476
10년 전 조회 626
10년 전 조회 1,062
10년 전 조회 666
10년 전 조회 517
10년 전 조회 453
10년 전 조회 490
10년 전 조회 546
10년 전 조회 471
10년 전 조회 538
10년 전 조회 457
10년 전 조회 588
🐛 버그신고