pushbullet 푸시 발송

· 10년 전 · 708

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년 전 조회 419
9년 전 조회 345
9년 전 조회 459
9년 전 조회 388
9년 전 조회 328
9년 전 조회 295
9년 전 조회 347
9년 전 조회 295
9년 전 조회 330
9년 전 조회 357
9년 전 조회 291
9년 전 조회 346
9년 전 조회 307
9년 전 조회 417
9년 전 조회 504
10년 전 조회 462
10년 전 조회 413
10년 전 조회 365
10년 전 조회 429
10년 전 조회 364
10년 전 조회 390
10년 전 조회 341
10년 전 조회 308
10년 전 조회 312
10년 전 조회 345
10년 전 조회 415
10년 전 조회 378
10년 전 조회 430
10년 전 조회 358
10년 전 조회 356
10년 전 조회 357
10년 전 조회 397
10년 전 조회 484
10년 전 조회 580
10년 전 조회 364
10년 전 조회 424
10년 전 조회 362
10년 전 조회 276
10년 전 조회 290
10년 전 조회 478
10년 전 조회 343
10년 전 조회 331
10년 전 조회 329
10년 전 조회 481
10년 전 조회 492
10년 전 조회 997
10년 전 조회 384
10년 전 조회 451
10년 전 조회 358
10년 전 조회 709
10년 전 조회 437
10년 전 조회 414
10년 전 조회 427
10년 전 조회 337
10년 전 조회 565
10년 전 조회 478
10년 전 조회 309
10년 전 조회 393
10년 전 조회 540
10년 전 조회 268
10년 전 조회 310
10년 전 조회 330
10년 전 조회 748
10년 전 조회 441
10년 전 조회 446
10년 전 조회 507
10년 전 조회 456
10년 전 조회 672
10년 전 조회 542
10년 전 조회 489
10년 전 조회 491
10년 전 조회 480
10년 전 조회 463
10년 전 조회 395
10년 전 조회 871
10년 전 조회 383
10년 전 조회 418
10년 전 조회 624
10년 전 조회 405
10년 전 조회 469
10년 전 조회 325
10년 전 조회 574
10년 전 조회 405
10년 전 조회 377
10년 전 조회 374
10년 전 조회 1,038
10년 전 조회 422
10년 전 조회 409
10년 전 조회 396
10년 전 조회 531
10년 전 조회 988
10년 전 조회 565
10년 전 조회 412
10년 전 조회 370
10년 전 조회 386
10년 전 조회 447
10년 전 조회 373
10년 전 조회 434
10년 전 조회 357
10년 전 조회 500
🐛 버그신고