pushbullet 푸시 발송

· 10년 전 · 761

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년 전 조회 468
9년 전 조회 399
9년 전 조회 513
9년 전 조회 445
9년 전 조회 378
9년 전 조회 342
9년 전 조회 396
9년 전 조회 344
9년 전 조회 378
9년 전 조회 405
9년 전 조회 337
9년 전 조회 387
9년 전 조회 355
9년 전 조회 454
9년 전 조회 555
10년 전 조회 511
10년 전 조회 464
10년 전 조회 390
10년 전 조회 477
10년 전 조회 408
10년 전 조회 436
10년 전 조회 384
10년 전 조회 360
10년 전 조회 357
10년 전 조회 389
10년 전 조회 461
10년 전 조회 419
10년 전 조회 476
10년 전 조회 398
10년 전 조회 402
10년 전 조회 406
10년 전 조회 447
10년 전 조회 531
10년 전 조회 629
10년 전 조회 416
10년 전 조회 472
10년 전 조회 399
10년 전 조회 327
10년 전 조회 340
10년 전 조회 513
10년 전 조회 396
10년 전 조회 382
10년 전 조회 374
10년 전 조회 526
10년 전 조회 535
10년 전 조회 1,049
10년 전 조회 436
10년 전 조회 500
10년 전 조회 417
10년 전 조회 762
10년 전 조회 490
10년 전 조회 473
10년 전 조회 450
10년 전 조회 391
10년 전 조회 625
10년 전 조회 536
10년 전 조회 359
10년 전 조회 454
10년 전 조회 591
10년 전 조회 311
10년 전 조회 370
10년 전 조회 380
10년 전 조회 809
10년 전 조회 493
10년 전 조회 502
10년 전 조회 534
10년 전 조회 501
10년 전 조회 727
10년 전 조회 602
10년 전 조회 543
10년 전 조회 528
10년 전 조회 538
10년 전 조회 523
10년 전 조회 453
10년 전 조회 927
10년 전 조회 436
10년 전 조회 463
10년 전 조회 689
10년 전 조회 462
10년 전 조회 527
10년 전 조회 385
10년 전 조회 650
10년 전 조회 461
10년 전 조회 411
10년 전 조회 417
10년 전 조회 1,097
10년 전 조회 474
10년 전 조회 471
10년 전 조회 444
10년 전 조회 593
10년 전 조회 1,031
10년 전 조회 628
10년 전 조회 480
10년 전 조회 421
10년 전 조회 454
10년 전 조회 511
10년 전 조회 437
10년 전 조회 505
10년 전 조회 417
10년 전 조회 560
🐛 버그신고