pushbullet 푸시 발송

· 10년 전 · 744

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년 전 조회 454
9년 전 조회 381
9년 전 조회 495
9년 전 조회 429
9년 전 조회 368
9년 전 조회 331
9년 전 조회 387
9년 전 조회 330
9년 전 조회 364
9년 전 조회 392
9년 전 조회 327
9년 전 조회 380
9년 전 조회 347
9년 전 조회 442
9년 전 조회 539
10년 전 조회 499
10년 전 조회 453
10년 전 조회 384
10년 전 조회 461
10년 전 조회 399
10년 전 조회 423
10년 전 조회 373
10년 전 조회 344
10년 전 조회 347
10년 전 조회 378
10년 전 조회 445
10년 전 조회 410
10년 전 조회 457
10년 전 조회 390
10년 전 조회 390
10년 전 조회 399
10년 전 조회 433
10년 전 조회 520
10년 전 조회 617
10년 전 조회 402
10년 전 조회 458
10년 전 조회 388
10년 전 조회 312
10년 전 조회 333
10년 전 조회 505
10년 전 조회 383
10년 전 조회 367
10년 전 조회 360
10년 전 조회 512
10년 전 조회 523
10년 전 조회 1,036
10년 전 조회 420
10년 전 조회 484
10년 전 조회 406
10년 전 조회 745
10년 전 조회 476
10년 전 조회 455
10년 전 조회 443
10년 전 조회 374
10년 전 조회 609
10년 전 조회 519
10년 전 조회 344
10년 전 조회 435
10년 전 조회 569
10년 전 조회 299
10년 전 조회 356
10년 전 조회 370
10년 전 조회 789
10년 전 조회 479
10년 전 조회 487
10년 전 조회 524
10년 전 조회 491
10년 전 조회 717
10년 전 조회 584
10년 전 조회 522
10년 전 조회 518
10년 전 조회 515
10년 전 조회 509
10년 전 조회 437
10년 전 조회 916
10년 전 조회 419
10년 전 조회 447
10년 전 조회 671
10년 전 조회 444
10년 전 조회 511
10년 전 조회 368
10년 전 조회 630
10년 전 조회 446
10년 전 조회 397
10년 전 조회 402
10년 전 조회 1,074
10년 전 조회 457
10년 전 조회 454
10년 전 조회 426
10년 전 조회 580
10년 전 조회 1,021
10년 전 조회 610
10년 전 조회 459
10년 전 조회 405
10년 전 조회 435
10년 전 조회 486
10년 전 조회 417
10년 전 조회 486
10년 전 조회 397
10년 전 조회 536
🐛 버그신고