pushbullet 푸시 발송

· 10년 전 · 718

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년 전 조회 429
9년 전 조회 361
9년 전 조회 477
9년 전 조회 406
9년 전 조회 346
9년 전 조회 310
9년 전 조회 363
9년 전 조회 315
9년 전 조회 347
9년 전 조회 375
9년 전 조회 308
9년 전 조회 358
9년 전 조회 326
9년 전 조회 427
9년 전 조회 521
10년 전 조회 479
10년 전 조회 427
10년 전 조회 373
10년 전 조회 447
10년 전 조회 380
10년 전 조회 403
10년 전 조회 353
10년 전 조회 325
10년 전 조회 327
10년 전 조회 358
10년 전 조회 425
10년 전 조회 388
10년 전 조회 442
10년 전 조회 373
10년 전 조회 373
10년 전 조회 372
10년 전 조회 413
10년 전 조회 495
10년 전 조회 598
10년 전 조회 380
10년 전 조회 439
10년 전 조회 374
10년 전 조회 288
10년 전 조회 309
10년 전 조회 489
10년 전 조회 362
10년 전 조회 344
10년 전 조회 339
10년 전 조회 495
10년 전 조회 502
10년 전 조회 1,014
10년 전 조회 400
10년 전 조회 466
10년 전 조회 374
10년 전 조회 719
10년 전 조회 448
10년 전 조회 432
10년 전 조회 435
10년 전 조회 346
10년 전 조회 580
10년 전 조회 498
10년 전 조회 320
10년 전 조회 410
10년 전 조회 552
10년 전 조회 282
10년 전 조회 325
10년 전 조회 340
10년 전 조회 764
10년 전 조회 458
10년 전 조회 464
10년 전 조회 516
10년 전 조회 467
10년 전 조회 690
10년 전 조회 557
10년 전 조회 504
10년 전 조회 501
10년 전 조회 493
10년 전 조회 478
10년 전 조회 410
10년 전 조회 887
10년 전 조회 397
10년 전 조회 429
10년 전 조회 644
10년 전 조회 420
10년 전 조회 487
10년 전 조회 337
10년 전 조회 601
10년 전 조회 421
10년 전 조회 384
10년 전 조회 383
10년 전 조회 1,051
10년 전 조회 436
10년 전 조회 428
10년 전 조회 409
10년 전 조회 548
10년 전 조회 1,001
10년 전 조회 585
10년 전 조회 426
10년 전 조회 382
10년 전 조회 406
10년 전 조회 461
10년 전 조회 389
10년 전 조회 453
10년 전 조회 369
10년 전 조회 512
🐛 버그신고