pushbullet 푸시 발송

· 10년 전 · 661

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년 전 조회 370
9년 전 조회 291
9년 전 조회 408
9년 전 조회 342
9년 전 조회 275
9년 전 조회 244
9년 전 조회 294
9년 전 조회 239
9년 전 조회 280
9년 전 조회 302
9년 전 조회 242
9년 전 조회 297
9년 전 조회 255
9년 전 조회 369
9년 전 조회 456
10년 전 조회 414
10년 전 조회 364
10년 전 조회 321
10년 전 조회 370
10년 전 조회 311
10년 전 조회 340
10년 전 조회 293
10년 전 조회 262
10년 전 조회 271
10년 전 조회 304
10년 전 조회 362
10년 전 조회 329
10년 전 조회 382
10년 전 조회 304
10년 전 조회 303
10년 전 조회 306
10년 전 조회 337
10년 전 조회 428
10년 전 조회 535
10년 전 조회 317
10년 전 조회 379
10년 전 조회 317
10년 전 조회 226
10년 전 조회 245
10년 전 조회 441
10년 전 조회 295
10년 전 조회 287
10년 전 조회 280
10년 전 조회 424
10년 전 조회 452
10년 전 조회 953
10년 전 조회 337
10년 전 조회 410
10년 전 조회 318
10년 전 조회 662
10년 전 조회 406
10년 전 조회 371
10년 전 조회 405
10년 전 조회 303
10년 전 조회 528
10년 전 조회 434
10년 전 조회 265
10년 전 조회 349
10년 전 조회 505
10년 전 조회 240
10년 전 조회 267
10년 전 조회 296
10년 전 조회 710
10년 전 조회 402
10년 전 조회 403
10년 전 조회 477
10년 전 조회 416
10년 전 조회 638
10년 전 조회 502
10년 전 조회 437
10년 전 조회 461
10년 전 조회 442
10년 전 조회 424
10년 전 조회 358
10년 전 조회 824
10년 전 조회 342
10년 전 조회 377
10년 전 조회 586
10년 전 조회 368
10년 전 조회 434
10년 전 조회 284
10년 전 조회 532
10년 전 조회 372
10년 전 조회 350
10년 전 조회 353
10년 전 조회 1,002
10년 전 조회 389
10년 전 조회 378
10년 전 조회 367
10년 전 조회 500
10년 전 조회 952
10년 전 조회 534
10년 전 조회 383
10년 전 조회 343
10년 전 조회 357
10년 전 조회 423
10년 전 조회 340
10년 전 조회 406
10년 전 조회 327
10년 전 조회 471
🐛 버그신고