pushbullet 푸시 발송

· 10년 전 · 838

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년 전 조회 543
10년 전 조회 475
10년 전 조회 576
10년 전 조회 514
10년 전 조회 454
10년 전 조회 415
10년 전 조회 464
10년 전 조회 408
10년 전 조회 448
10년 전 조회 479
10년 전 조회 411
10년 전 조회 466
10년 전 조회 427
10년 전 조회 527
10년 전 조회 627
10년 전 조회 584
10년 전 조회 541
10년 전 조회 470
10년 전 조회 556
10년 전 조회 473
10년 전 조회 513
10년 전 조회 461
10년 전 조회 438
10년 전 조회 442
10년 전 조회 467
10년 전 조회 538
10년 전 조회 490
10년 전 조회 551
10년 전 조회 471
10년 전 조회 486
10년 전 조회 481
10년 전 조회 517
10년 전 조회 612
10년 전 조회 703
10년 전 조회 484
10년 전 조회 553
10년 전 조회 480
10년 전 조회 405
10년 전 조회 419
10년 전 조회 598
10년 전 조회 479
10년 전 조회 458
10년 전 조회 458
10년 전 조회 610
10년 전 조회 616
10년 전 조회 1,131
10년 전 조회 513
10년 전 조회 582
10년 전 조회 497
10년 전 조회 839
10년 전 조회 564
10년 전 조회 548
10년 전 조회 528
10년 전 조회 475
10년 전 조회 715
10년 전 조회 621
10년 전 조회 440
10년 전 조회 539
10년 전 조회 669
10년 전 조회 403
10년 전 조회 441
10년 전 조회 461
10년 전 조회 893
10년 전 조회 576
10년 전 조회 585
10년 전 조회 602
10년 전 조회 584
10년 전 조회 813
10년 전 조회 682
10년 전 조회 630
10년 전 조회 629
10년 전 조회 620
10년 전 조회 608
10년 전 조회 544
10년 전 조회 1,013
10년 전 조회 524
10년 전 조회 549
10년 전 조회 769
10년 전 조회 546
10년 전 조회 602
10년 전 조회 459
10년 전 조회 741
10년 전 조회 544
10년 전 조회 487
10년 전 조회 483
10년 전 조회 1,181
10년 전 조회 560
10년 전 조회 560
10년 전 조회 524
10년 전 조회 680
10년 전 조회 1,121
10년 전 조회 711
10년 전 조회 568
10년 전 조회 504
10년 전 조회 542
10년 전 조회 592
10년 전 조회 531
10년 전 조회 594
10년 전 조회 513
10년 전 조회 651
🐛 버그신고