pushbullet 푸시 발송

· 10년 전 · 704

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년 전 조회 413
9년 전 조회 340
9년 전 조회 457
9년 전 조회 386
9년 전 조회 325
9년 전 조회 291
9년 전 조회 344
9년 전 조회 292
9년 전 조회 327
9년 전 조회 354
9년 전 조회 285
9년 전 조회 342
9년 전 조회 304
9년 전 조회 413
9년 전 조회 501
10년 전 조회 460
10년 전 조회 407
10년 전 조회 361
10년 전 조회 424
10년 전 조회 361
10년 전 조회 387
10년 전 조회 336
10년 전 조회 305
10년 전 조회 307
10년 전 조회 343
10년 전 조회 414
10년 전 조회 373
10년 전 조회 427
10년 전 조회 356
10년 전 조회 352
10년 전 조회 356
10년 전 조회 397
10년 전 조회 481
10년 전 조회 579
10년 전 조회 361
10년 전 조회 421
10년 전 조회 360
10년 전 조회 275
10년 전 조회 290
10년 전 조회 475
10년 전 조회 339
10년 전 조회 330
10년 전 조회 324
10년 전 조회 480
10년 전 조회 489
10년 전 조회 992
10년 전 조회 380
10년 전 조회 449
10년 전 조회 355
10년 전 조회 704
10년 전 조회 434
10년 전 조회 411
10년 전 조회 427
10년 전 조회 333
10년 전 조회 563
10년 전 조회 474
10년 전 조회 304
10년 전 조회 388
10년 전 조회 539
10년 전 조회 264
10년 전 조회 305
10년 전 조회 326
10년 전 조회 745
10년 전 조회 437
10년 전 조회 443
10년 전 조회 504
10년 전 조회 452
10년 전 조회 671
10년 전 조회 538
10년 전 조회 485
10년 전 조회 488
10년 전 조회 476
10년 전 조회 459
10년 전 조회 392
10년 전 조회 864
10년 전 조회 378
10년 전 조회 414
10년 전 조회 619
10년 전 조회 401
10년 전 조회 466
10년 전 조회 321
10년 전 조회 570
10년 전 조회 399
10년 전 조회 374
10년 전 조회 371
10년 전 조회 1,031
10년 전 조회 416
10년 전 조회 404
10년 전 조회 392
10년 전 조회 525
10년 전 조회 982
10년 전 조회 561
10년 전 조회 407
10년 전 조회 370
10년 전 조회 383
10년 전 조회 445
10년 전 조회 370
10년 전 조회 431
10년 전 조회 354
10년 전 조회 495
🐛 버그신고