pushbullet 푸시 발송

· 10년 전 · 675

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년 전 조회 396
9년 전 조회 323
9년 전 조회 441
9년 전 조회 369
9년 전 조회 303
9년 전 조회 279
9년 전 조회 321
9년 전 조회 275
9년 전 조회 310
9년 전 조회 335
9년 전 조회 269
9년 전 조회 331
9년 전 조회 289
9년 전 조회 403
9년 전 조회 484
10년 전 조회 444
10년 전 조회 391
10년 전 조회 348
10년 전 조회 401
10년 전 조회 342
10년 전 조회 364
10년 전 조회 328
10년 전 조회 287
10년 전 조회 298
10년 전 조회 328
10년 전 조회 391
10년 전 조회 362
10년 전 조회 407
10년 전 조회 339
10년 전 조회 327
10년 전 조회 336
10년 전 조회 367
10년 전 조회 456
10년 전 조회 559
10년 전 조회 348
10년 전 조회 400
10년 전 조회 344
10년 전 조회 249
10년 전 조회 271
10년 전 조회 461
10년 전 조회 314
10년 전 조회 309
10년 전 조회 300
10년 전 조회 450
10년 전 조회 472
10년 전 조회 969
10년 전 조회 351
10년 전 조회 428
10년 전 조회 336
10년 전 조회 676
10년 전 조회 415
10년 전 조회 387
10년 전 조회 414
10년 전 조회 317
10년 전 조회 540
10년 전 조회 449
10년 전 조회 278
10년 전 조회 365
10년 전 조회 522
10년 전 조회 249
10년 전 조회 287
10년 전 조회 307
10년 전 조회 725
10년 전 조회 419
10년 전 조회 418
10년 전 조회 485
10년 전 조회 432
10년 전 조회 657
10년 전 조회 520
10년 전 조회 461
10년 전 조회 475
10년 전 조회 457
10년 전 조회 437
10년 전 조회 370
10년 전 조회 841
10년 전 조회 352
10년 전 조회 388
10년 전 조회 597
10년 전 조회 382
10년 전 조회 449
10년 전 조회 300
10년 전 조회 546
10년 전 조회 383
10년 전 조회 360
10년 전 조회 359
10년 전 조회 1,010
10년 전 조회 397
10년 전 조회 389
10년 전 조회 380
10년 전 조회 510
10년 전 조회 965
10년 전 조회 544
10년 전 조회 390
10년 전 조회 352
10년 전 조회 367
10년 전 조회 431
10년 전 조회 350
10년 전 조회 412
10년 전 조회 334
10년 전 조회 479
🐛 버그신고