pushbullet 푸시 발송

· 10년 전 · 673

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년 전 조회 396
9년 전 조회 322
9년 전 조회 440
9년 전 조회 369
9년 전 조회 303
9년 전 조회 278
9년 전 조회 320
9년 전 조회 275
9년 전 조회 309
9년 전 조회 335
9년 전 조회 269
9년 전 조회 329
9년 전 조회 288
9년 전 조회 402
9년 전 조회 483
10년 전 조회 443
10년 전 조회 390
10년 전 조회 347
10년 전 조회 400
10년 전 조회 341
10년 전 조회 363
10년 전 조회 325
10년 전 조회 286
10년 전 조회 298
10년 전 조회 328
10년 전 조회 390
10년 전 조회 361
10년 전 조회 406
10년 전 조회 338
10년 전 조회 326
10년 전 조회 334
10년 전 조회 366
10년 전 조회 456
10년 전 조회 559
10년 전 조회 346
10년 전 조회 400
10년 전 조회 343
10년 전 조회 248
10년 전 조회 270
10년 전 조회 461
10년 전 조회 312
10년 전 조회 309
10년 전 조회 299
10년 전 조회 450
10년 전 조회 471
10년 전 조회 969
10년 전 조회 351
10년 전 조회 428
10년 전 조회 335
10년 전 조회 674
10년 전 조회 415
10년 전 조회 385
10년 전 조회 414
10년 전 조회 316
10년 전 조회 540
10년 전 조회 448
10년 전 조회 277
10년 전 조회 363
10년 전 조회 520
10년 전 조회 249
10년 전 조회 286
10년 전 조회 306
10년 전 조회 725
10년 전 조회 416
10년 전 조회 418
10년 전 조회 485
10년 전 조회 431
10년 전 조회 656
10년 전 조회 520
10년 전 조회 459
10년 전 조회 475
10년 전 조회 456
10년 전 조회 436
10년 전 조회 370
10년 전 조회 839
10년 전 조회 351
10년 전 조회 387
10년 전 조회 596
10년 전 조회 381
10년 전 조회 448
10년 전 조회 300
10년 전 조회 546
10년 전 조회 383
10년 전 조회 360
10년 전 조회 359
10년 전 조회 1,010
10년 전 조회 397
10년 전 조회 389
10년 전 조회 380
10년 전 조회 510
10년 전 조회 964
10년 전 조회 544
10년 전 조회 390
10년 전 조회 351
10년 전 조회 367
10년 전 조회 431
10년 전 조회 349
10년 전 조회 412
10년 전 조회 334
10년 전 조회 478
🐛 버그신고