pushbullet 푸시 발송

· 10년 전 · 697

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년 전 조회 408
9년 전 조회 336
9년 전 조회 452
9년 전 조회 384
9년 전 조회 318
9년 전 조회 288
9년 전 조회 343
9년 전 조회 290
9년 전 조회 324
9년 전 조회 350
9년 전 조회 281
9년 전 조회 340
9년 전 조회 302
9년 전 조회 408
9년 전 조회 499
10년 전 조회 456
10년 전 조회 404
10년 전 조회 360
10년 전 조회 418
10년 전 조회 355
10년 전 조회 381
10년 전 조회 333
10년 전 조회 302
10년 전 조회 302
10년 전 조회 335
10년 전 조회 412
10년 전 조회 369
10년 전 조회 422
10년 전 조회 352
10년 전 조회 349
10년 전 조회 355
10년 전 조회 394
10년 전 조회 475
10년 전 조회 575
10년 전 조회 360
10년 전 조회 417
10년 전 조회 356
10년 전 조회 271
10년 전 조회 285
10년 전 조회 474
10년 전 조회 336
10년 전 조회 327
10년 전 조회 318
10년 전 조회 475
10년 전 조회 485
10년 전 조회 989
10년 전 조회 374
10년 전 조회 446
10년 전 조회 351
10년 전 조회 698
10년 전 조회 430
10년 전 조회 406
10년 전 조회 425
10년 전 조회 332
10년 전 조회 559
10년 전 조회 469
10년 전 조회 299
10년 전 조회 384
10년 전 조회 537
10년 전 조회 261
10년 전 조회 303
10년 전 조회 323
10년 전 조회 744
10년 전 조회 433
10년 전 조회 442
10년 전 조회 501
10년 전 조회 448
10년 전 조회 668
10년 전 조회 535
10년 전 조회 480
10년 전 조회 487
10년 전 조회 471
10년 전 조회 455
10년 전 조회 387
10년 전 조회 856
10년 전 조회 370
10년 전 조회 409
10년 전 조회 616
10년 전 조회 395
10년 전 조회 463
10년 전 조회 315
10년 전 조회 566
10년 전 조회 397
10년 전 조회 372
10년 전 조회 370
10년 전 조회 1,026
10년 전 조회 412
10년 전 조회 404
10년 전 조회 391
10년 전 조회 524
10년 전 조회 981
10년 전 조회 558
10년 전 조회 406
10년 전 조회 367
10년 전 조회 380
10년 전 조회 444
10년 전 조회 367
10년 전 조회 430
10년 전 조회 352
10년 전 조회 491
🐛 버그신고