pushbullet 푸시 발송

· 10년 전 · 721

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년 전 조회 431
9년 전 조회 365
9년 전 조회 481
9년 전 조회 411
9년 전 조회 347
9년 전 조회 313
9년 전 조회 365
9년 전 조회 316
9년 전 조회 349
9년 전 조회 377
9년 전 조회 310
9년 전 조회 362
9년 전 조회 327
9년 전 조회 430
9년 전 조회 523
10년 전 조회 482
10년 전 조회 430
10년 전 조회 375
10년 전 조회 448
10년 전 조회 382
10년 전 조회 405
10년 전 조회 355
10년 전 조회 327
10년 전 조회 329
10년 전 조회 361
10년 전 조회 428
10년 전 조회 393
10년 전 조회 443
10년 전 조회 375
10년 전 조회 376
10년 전 조회 378
10년 전 조회 414
10년 전 조회 498
10년 전 조회 601
10년 전 조회 384
10년 전 조회 441
10년 전 조회 378
10년 전 조회 290
10년 전 조회 312
10년 전 조회 490
10년 전 조회 363
10년 전 조회 346
10년 전 조회 341
10년 전 조회 497
10년 전 조회 504
10년 전 조회 1,016
10년 전 조회 405
10년 전 조회 472
10년 전 조회 376
10년 전 조회 722
10년 전 조회 451
10년 전 조회 433
10년 전 조회 436
10년 전 조회 350
10년 전 조회 581
10년 전 조회 499
10년 전 조회 322
10년 전 조회 411
10년 전 조회 555
10년 전 조회 284
10년 전 조회 326
10년 전 조회 342
10년 전 조회 766
10년 전 조회 461
10년 전 조회 468
10년 전 조회 519
10년 전 조회 470
10년 전 조회 693
10년 전 조회 559
10년 전 조회 506
10년 전 조회 504
10년 전 조회 494
10년 전 조회 480
10년 전 조회 413
10년 전 조회 889
10년 전 조회 399
10년 전 조회 433
10년 전 조회 648
10년 전 조회 421
10년 전 조회 492
10년 전 조회 340
10년 전 조회 602
10년 전 조회 425
10년 전 조회 385
10년 전 조회 384
10년 전 조회 1,051
10년 전 조회 439
10년 전 조회 429
10년 전 조회 410
10년 전 조회 551
10년 전 조회 1,006
10년 전 조회 589
10년 전 조회 429
10년 전 조회 385
10년 전 조회 409
10년 전 조회 462
10년 전 조회 392
10년 전 조회 456
10년 전 조회 370
10년 전 조회 514
🐛 버그신고