pushbullet 푸시 발송

· 10년 전 · 713

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년 전 조회 423
9년 전 조회 350
9년 전 조회 468
9년 전 조회 393
9년 전 조회 335
9년 전 조회 302
9년 전 조회 351
9년 전 조회 304
9년 전 조회 338
9년 전 조회 365
9년 전 조회 297
9년 전 조회 352
9년 전 조회 313
9년 전 조회 422
9년 전 조회 511
10년 전 조회 466
10년 전 조회 416
10년 전 조회 367
10년 전 조회 435
10년 전 조회 369
10년 전 조회 396
10년 전 조회 346
10년 전 조회 315
10년 전 조회 317
10년 전 조회 350
10년 전 조회 419
10년 전 조회 382
10년 전 조회 435
10년 전 조회 364
10년 전 조회 364
10년 전 조회 361
10년 전 조회 401
10년 전 조회 488
10년 전 조회 586
10년 전 조회 369
10년 전 조회 431
10년 전 조회 367
10년 전 조회 280
10년 전 조회 298
10년 전 조회 481
10년 전 조회 349
10년 전 조회 337
10년 전 조회 335
10년 전 조회 487
10년 전 조회 496
10년 전 조회 1,003
10년 전 조회 390
10년 전 조회 458
10년 전 조회 363
10년 전 조회 714
10년 전 조회 442
10년 전 조회 420
10년 전 조회 430
10년 전 조회 342
10년 전 조회 571
10년 전 조회 486
10년 전 조회 312
10년 전 조회 400
10년 전 조회 546
10년 전 조회 275
10년 전 조회 314
10년 전 조회 335
10년 전 조회 755
10년 전 조회 450
10년 전 조회 454
10년 전 조회 510
10년 전 조회 462
10년 전 조회 680
10년 전 조회 549
10년 전 조회 495
10년 전 조회 496
10년 전 조회 485
10년 전 조회 469
10년 전 조회 400
10년 전 조회 878
10년 전 조회 388
10년 전 조회 424
10년 전 조회 630
10년 전 조회 410
10년 전 조회 477
10년 전 조회 330
10년 전 조회 583
10년 전 조회 413
10년 전 조회 381
10년 전 조회 379
10년 전 조회 1,044
10년 전 조회 430
10년 전 조회 418
10년 전 조회 404
10년 전 조회 538
10년 전 조회 994
10년 전 조회 578
10년 전 조회 415
10년 전 조회 375
10년 전 조회 396
10년 전 조회 455
10년 전 조회 380
10년 전 조회 441
10년 전 조회 363
10년 전 조회 508
🐛 버그신고