pushbullet 푸시 발송

· 10년 전 · 690

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년 전 조회 404
9년 전 조회 333
9년 전 조회 449
9년 전 조회 380
9년 전 조회 315
9년 전 조회 285
9년 전 조회 335
9년 전 조회 284
9년 전 조회 319
9년 전 조회 345
9년 전 조회 278
9년 전 조회 338
9년 전 조회 295
9년 전 조회 407
9년 전 조회 492
10년 전 조회 452
10년 전 조회 400
10년 전 조회 356
10년 전 조회 412
10년 전 조회 350
10년 전 조회 373
10년 전 조회 331
10년 전 조회 296
10년 전 조회 301
10년 전 조회 333
10년 전 조회 403
10년 전 조회 367
10년 전 조회 419
10년 전 조회 348
10년 전 조회 340
10년 전 조회 347
10년 전 조회 385
10년 전 조회 469
10년 전 조회 570
10년 전 조회 359
10년 전 조회 409
10년 전 조회 352
10년 전 조회 263
10년 전 조회 280
10년 전 조회 469
10년 전 조회 329
10년 전 조회 323
10년 전 조회 311
10년 전 조회 467
10년 전 조회 480
10년 전 조회 985
10년 전 조회 368
10년 전 조회 442
10년 전 조회 346
10년 전 조회 691
10년 전 조회 424
10년 전 조회 399
10년 전 조회 424
10년 전 조회 328
10년 전 조회 554
10년 전 조회 462
10년 전 조회 291
10년 전 조회 376
10년 전 조회 532
10년 전 조회 258
10년 전 조회 295
10년 전 조회 318
10년 전 조회 736
10년 전 조회 426
10년 전 조회 430
10년 전 조회 497
10년 전 조회 442
10년 전 조회 666
10년 전 조회 529
10년 전 조회 473
10년 전 조회 482
10년 전 조회 467
10년 전 조회 447
10년 전 조회 380
10년 전 조회 852
10년 전 조회 363
10년 전 조회 401
10년 전 조회 608
10년 전 조회 392
10년 전 조회 457
10년 전 조회 312
10년 전 조회 557
10년 전 조회 392
10년 전 조회 367
10년 전 조회 364
10년 전 조회 1,023
10년 전 조회 408
10년 전 조회 398
10년 전 조회 387
10년 전 조회 518
10년 전 조회 978
10년 전 조회 552
10년 전 조회 397
10년 전 조회 362
10년 전 조회 378
10년 전 조회 441
10년 전 조회 360
10년 전 조회 421
10년 전 조회 343
10년 전 조회 486
🐛 버그신고