pushbullet 푸시 발송

· 10년 전 · 785

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년 전 조회 491
9년 전 조회 413
9년 전 조회 535
9년 전 조회 461
9년 전 조회 403
9년 전 조회 360
9년 전 조회 414
9년 전 조회 357
9년 전 조회 394
9년 전 조회 425
9년 전 조회 363
10년 전 조회 406
10년 전 조회 373
10년 전 조회 478
10년 전 조회 572
10년 전 조회 528
10년 전 조회 486
10년 전 조회 413
10년 전 조회 501
10년 전 조회 420
10년 전 조회 450
10년 전 조회 406
10년 전 조회 375
10년 전 조회 377
10년 전 조회 413
10년 전 조회 483
10년 전 조회 433
10년 전 조회 494
10년 전 조회 413
10년 전 조회 427
10년 전 조회 424
10년 전 조회 461
10년 전 조회 553
10년 전 조회 648
10년 전 조회 431
10년 전 조회 488
10년 전 조회 417
10년 전 조회 348
10년 전 조회 354
10년 전 조회 534
10년 전 조회 420
10년 전 조회 399
10년 전 조회 397
10년 전 조회 551
10년 전 조회 549
10년 전 조회 1,071
10년 전 조회 454
10년 전 조회 521
10년 전 조회 430
10년 전 조회 786
10년 전 조회 503
10년 전 조회 489
10년 전 조회 467
10년 전 조회 416
10년 전 조회 653
10년 전 조회 555
10년 전 조회 383
10년 전 조회 476
10년 전 조회 610
10년 전 조회 336
10년 전 조회 391
10년 전 조회 393
10년 전 조회 835
10년 전 조회 515
10년 전 조회 522
10년 전 조회 551
10년 전 조회 524
10년 전 조회 753
10년 전 조회 622
10년 전 조회 561
10년 전 조회 559
10년 전 조회 556
10년 전 조회 541
10년 전 조회 477
10년 전 조회 956
10년 전 조회 463
10년 전 조회 484
10년 전 조회 707
10년 전 조회 489
10년 전 조회 552
10년 전 조회 404
10년 전 조회 671
10년 전 조회 495
10년 전 조회 432
10년 전 조회 433
10년 전 조회 1,126
10년 전 조회 502
10년 전 조회 494
10년 전 조회 466
10년 전 조회 617
10년 전 조회 1,054
10년 전 조회 657
10년 전 조회 509
10년 전 조회 446
10년 전 조회 481
10년 전 조회 538
10년 전 조회 464
10년 전 조회 535
10년 전 조회 446
10년 전 조회 584
🐛 버그신고