pushbullet 푸시 발송

· 10년 전 · 668

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년 전 조회 392
9년 전 조회 313
9년 전 조회 433
9년 전 조회 363
9년 전 조회 298
9년 전 조회 272
9년 전 조회 316
9년 전 조회 270
9년 전 조회 303
9년 전 조회 331
9년 전 조회 264
9년 전 조회 324
9년 전 조회 282
9년 전 조회 396
9년 전 조회 478
10년 전 조회 438
10년 전 조회 385
10년 전 조회 344
10년 전 조회 394
10년 전 조회 337
10년 전 조회 358
10년 전 조회 321
10년 전 조회 282
10년 전 조회 295
10년 전 조회 323
10년 전 조회 386
10년 전 조회 355
10년 전 조회 404
10년 전 조회 332
10년 전 조회 322
10년 전 조회 330
10년 전 조회 359
10년 전 조회 451
10년 전 조회 556
10년 전 조회 341
10년 전 조회 393
10년 전 조회 339
10년 전 조회 242
10년 전 조회 264
10년 전 조회 460
10년 전 조회 306
10년 전 조회 304
10년 전 조회 293
10년 전 조회 443
10년 전 조회 466
10년 전 조회 963
10년 전 조회 348
10년 전 조회 422
10년 전 조회 330
10년 전 조회 669
10년 전 조회 412
10년 전 조회 380
10년 전 조회 412
10년 전 조회 311
10년 전 조회 534
10년 전 조회 442
10년 전 조회 275
10년 전 조회 358
10년 전 조회 513
10년 전 조회 248
10년 전 조회 278
10년 전 조회 302
10년 전 조회 718
10년 전 조회 412
10년 전 조회 415
10년 전 조회 485
10년 전 조회 426
10년 전 조회 648
10년 전 조회 512
10년 전 조회 448
10년 전 조회 471
10년 전 조회 449
10년 전 조회 429
10년 전 조회 367
10년 전 조회 833
10년 전 조회 348
10년 전 조회 382
10년 전 조회 592
10년 전 조회 373
10년 전 조회 442
10년 전 조회 291
10년 전 조회 542
10년 전 조회 381
10년 전 조회 358
10년 전 조회 356
10년 전 조회 1,007
10년 전 조회 395
10년 전 조회 387
10년 전 조회 375
10년 전 조회 507
10년 전 조회 959
10년 전 조회 541
10년 전 조회 388
10년 전 조회 350
10년 전 조회 366
10년 전 조회 429
10년 전 조회 346
10년 전 조회 412
10년 전 조회 333
10년 전 조회 475
🐛 버그신고