pushbullet 푸시 발송

· 10년 전 · 717

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년 전 조회 427
9년 전 조회 358
9년 전 조회 476
9년 전 조회 403
9년 전 조회 344
9년 전 조회 309
9년 전 조회 360
9년 전 조회 315
9년 전 조회 346
9년 전 조회 373
9년 전 조회 306
9년 전 조회 357
9년 전 조회 323
9년 전 조회 426
9년 전 조회 519
10년 전 조회 476
10년 전 조회 425
10년 전 조회 370
10년 전 조회 444
10년 전 조회 378
10년 전 조회 401
10년 전 조회 352
10년 전 조회 323
10년 전 조회 324
10년 전 조회 356
10년 전 조회 425
10년 전 조회 387
10년 전 조회 441
10년 전 조회 372
10년 전 조회 373
10년 전 조회 370
10년 전 조회 411
10년 전 조회 493
10년 전 조회 595
10년 전 조회 377
10년 전 조회 438
10년 전 조회 374
10년 전 조회 287
10년 전 조회 306
10년 전 조회 487
10년 전 조회 359
10년 전 조회 343
10년 전 조회 338
10년 전 조회 494
10년 전 조회 501
10년 전 조회 1,012
10년 전 조회 399
10년 전 조회 465
10년 전 조회 372
10년 전 조회 718
10년 전 조회 447
10년 전 조회 428
10년 전 조회 434
10년 전 조회 344
10년 전 조회 579
10년 전 조회 494
10년 전 조회 318
10년 전 조회 409
10년 전 조회 551
10년 전 조회 282
10년 전 조회 322
10년 전 조회 339
10년 전 조회 763
10년 전 조회 458
10년 전 조회 464
10년 전 조회 515
10년 전 조회 466
10년 전 조회 687
10년 전 조회 555
10년 전 조회 504
10년 전 조회 499
10년 전 조회 491
10년 전 조회 478
10년 전 조회 409
10년 전 조회 886
10년 전 조회 396
10년 전 조회 427
10년 전 조회 642
10년 전 조회 418
10년 전 조회 485
10년 전 조회 336
10년 전 조회 601
10년 전 조회 421
10년 전 조회 383
10년 전 조회 382
10년 전 조회 1,049
10년 전 조회 435
10년 전 조회 426
10년 전 조회 408
10년 전 조회 545
10년 전 조회 1,001
10년 전 조회 583
10년 전 조회 424
10년 전 조회 378
10년 전 조회 403
10년 전 조회 461
10년 전 조회 387
10년 전 조회 451
10년 전 조회 368
10년 전 조회 512
🐛 버그신고