pushbullet 푸시 발송

· 10년 전 · 800

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년 전 조회 503
9년 전 조회 429
9년 전 조회 544
9년 전 조회 472
9년 전 조회 413
9년 전 조회 376
9년 전 조회 422
9년 전 조회 374
9년 전 조회 408
9년 전 조회 439
9년 전 조회 374
10년 전 조회 420
10년 전 조회 385
10년 전 조회 494
10년 전 조회 583
10년 전 조회 541
10년 전 조회 498
10년 전 조회 426
10년 전 조회 511
10년 전 조회 434
10년 전 조회 459
10년 전 조회 418
10년 전 조회 391
10년 전 조회 396
10년 전 조회 435
10년 전 조회 492
10년 전 조회 449
10년 전 조회 507
10년 전 조회 429
10년 전 조회 446
10년 전 조회 433
10년 전 조회 479
10년 전 조회 567
10년 전 조회 657
10년 전 조회 439
10년 전 조회 512
10년 전 조회 433
10년 전 조회 364
10년 전 조회 366
10년 전 조회 545
10년 전 조회 433
10년 전 조회 419
10년 전 조회 410
10년 전 조회 564
10년 전 조회 567
10년 전 조회 1,084
10년 전 조회 471
10년 전 조회 542
10년 전 조회 447
10년 전 조회 801
10년 전 조회 518
10년 전 조회 506
10년 전 조회 481
10년 전 조회 434
10년 전 조회 674
10년 전 조회 576
10년 전 조회 396
10년 전 조회 495
10년 전 조회 622
10년 전 조회 348
10년 전 조회 408
10년 전 조회 412
10년 전 조회 847
10년 전 조회 529
10년 전 조회 537
10년 전 조회 564
10년 전 조회 543
10년 전 조회 773
10년 전 조회 636
10년 전 조회 578
10년 전 조회 582
10년 전 조회 577
10년 전 조회 562
10년 전 조회 493
10년 전 조회 970
10년 전 조회 477
10년 전 조회 505
10년 전 조회 718
10년 전 조회 505
10년 전 조회 561
10년 전 조회 420
10년 전 조회 689
10년 전 조회 506
10년 전 조회 446
10년 전 조회 450
10년 전 조회 1,138
10년 전 조회 520
10년 전 조회 507
10년 전 조회 480
10년 전 조회 631
10년 전 조회 1,070
10년 전 조회 674
10년 전 조회 524
10년 전 조회 459
10년 전 조회 498
10년 전 조회 550
10년 전 조회 483
10년 전 조회 544
10년 전 조회 462
10년 전 조회 599
🐛 버그신고