pushbullet 푸시 발송

· 10년 전 · 723

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년 전 조회 432
9년 전 조회 365
9년 전 조회 482
9년 전 조회 411
9년 전 조회 348
9년 전 조회 313
9년 전 조회 365
9년 전 조회 316
9년 전 조회 349
9년 전 조회 378
9년 전 조회 311
9년 전 조회 364
9년 전 조회 327
9년 전 조회 430
9년 전 조회 524
10년 전 조회 482
10년 전 조회 431
10년 전 조회 376
10년 전 조회 449
10년 전 조회 382
10년 전 조회 406
10년 전 조회 357
10년 전 조회 328
10년 전 조회 329
10년 전 조회 362
10년 전 조회 428
10년 전 조회 393
10년 전 조회 444
10년 전 조회 375
10년 전 조회 376
10년 전 조회 378
10년 전 조회 414
10년 전 조회 499
10년 전 조회 601
10년 전 조회 384
10년 전 조회 443
10년 전 조회 378
10년 전 조회 290
10년 전 조회 312
10년 전 조회 491
10년 전 조회 363
10년 전 조회 347
10년 전 조회 343
10년 전 조회 497
10년 전 조회 506
10년 전 조회 1,016
10년 전 조회 405
10년 전 조회 473
10년 전 조회 377
10년 전 조회 723
10년 전 조회 453
10년 전 조회 433
10년 전 조회 436
10년 전 조회 350
10년 전 조회 583
10년 전 조회 500
10년 전 조회 323
10년 전 조회 412
10년 전 조회 555
10년 전 조회 286
10년 전 조회 327
10년 전 조회 344
10년 전 조회 767
10년 전 조회 461
10년 전 조회 468
10년 전 조회 520
10년 전 조회 471
10년 전 조회 693
10년 전 조회 560
10년 전 조회 507
10년 전 조회 506
10년 전 조회 496
10년 전 조회 481
10년 전 조회 413
10년 전 조회 891
10년 전 조회 401
10년 전 조회 433
10년 전 조회 650
10년 전 조회 422
10년 전 조회 493
10년 전 조회 341
10년 전 조회 603
10년 전 조회 425
10년 전 조회 385
10년 전 조회 384
10년 전 조회 1,053
10년 전 조회 439
10년 전 조회 429
10년 전 조회 410
10년 전 조회 552
10년 전 조회 1,007
10년 전 조회 590
10년 전 조회 429
10년 전 조회 387
10년 전 조회 410
10년 전 조회 463
10년 전 조회 392
10년 전 조회 456
10년 전 조회 371
10년 전 조회 515
🐛 버그신고