pushbullet 푸시 발송

· 10년 전 · 662

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년 전 조회 380
9년 전 조회 302
9년 전 조회 419
9년 전 조회 350
9년 전 조회 286
9년 전 조회 256
9년 전 조회 303
9년 전 조회 252
9년 전 조회 290
9년 전 조회 314
9년 전 조회 253
9년 전 조회 312
9년 전 조회 266
9년 전 조회 385
9년 전 조회 466
10년 전 조회 422
10년 전 조회 374
10년 전 조회 330
10년 전 조회 380
10년 전 조회 321
10년 전 조회 350
10년 전 조회 309
10년 전 조회 272
10년 전 조회 284
10년 전 조회 314
10년 전 조회 371
10년 전 조회 343
10년 전 조회 392
10년 전 조회 315
10년 전 조회 310
10년 전 조회 315
10년 전 조회 347
10년 전 조회 440
10년 전 조회 542
10년 전 조회 326
10년 전 조회 385
10년 전 조회 326
10년 전 조회 235
10년 전 조회 253
10년 전 조회 450
10년 전 조회 299
10년 전 조회 295
10년 전 조회 285
10년 전 조회 428
10년 전 조회 457
10년 전 조회 956
10년 전 조회 339
10년 전 조회 411
10년 전 조회 319
10년 전 조회 663
10년 전 조회 407
10년 전 조회 375
10년 전 조회 407
10년 전 조회 304
10년 전 조회 530
10년 전 조회 437
10년 전 조회 266
10년 전 조회 352
10년 전 조회 506
10년 전 조회 241
10년 전 조회 270
10년 전 조회 297
10년 전 조회 712
10년 전 조회 405
10년 전 조회 406
10년 전 조회 479
10년 전 조회 418
10년 전 조회 640
10년 전 조회 504
10년 전 조회 439
10년 전 조회 465
10년 전 조회 444
10년 전 조회 424
10년 전 조회 361
10년 전 조회 827
10년 전 조회 343
10년 전 조회 377
10년 전 조회 586
10년 전 조회 368
10년 전 조회 434
10년 전 조회 286
10년 전 조회 533
10년 전 조회 372
10년 전 조회 350
10년 전 조회 354
10년 전 조회 1,003
10년 전 조회 389
10년 전 조회 378
10년 전 조회 367
10년 전 조회 502
10년 전 조회 953
10년 전 조회 536
10년 전 조회 383
10년 전 조회 344
10년 전 조회 358
10년 전 조회 425
10년 전 조회 344
10년 전 조회 409
10년 전 조회 331
10년 전 조회 473
🐛 버그신고