pushbullet 푸시 발송

· 10년 전 · 742

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년 전 조회 453
9년 전 조회 380
9년 전 조회 495
9년 전 조회 427
9년 전 조회 366
9년 전 조회 331
9년 전 조회 384
9년 전 조회 330
9년 전 조회 363
9년 전 조회 391
9년 전 조회 326
9년 전 조회 379
9년 전 조회 347
9년 전 조회 442
9년 전 조회 539
10년 전 조회 498
10년 전 조회 451
10년 전 조회 383
10년 전 조회 460
10년 전 조회 399
10년 전 조회 423
10년 전 조회 372
10년 전 조회 344
10년 전 조회 346
10년 전 조회 377
10년 전 조회 443
10년 전 조회 410
10년 전 조회 455
10년 전 조회 390
10년 전 조회 389
10년 전 조회 397
10년 전 조회 431
10년 전 조회 518
10년 전 조회 617
10년 전 조회 402
10년 전 조회 458
10년 전 조회 388
10년 전 조회 310
10년 전 조회 332
10년 전 조회 505
10년 전 조회 381
10년 전 조회 367
10년 전 조회 358
10년 전 조회 511
10년 전 조회 523
10년 전 조회 1,034
10년 전 조회 420
10년 전 조회 484
10년 전 조회 406
10년 전 조회 743
10년 전 조회 476
10년 전 조회 454
10년 전 조회 442
10년 전 조회 372
10년 전 조회 609
10년 전 조회 517
10년 전 조회 343
10년 전 조회 433
10년 전 조회 569
10년 전 조회 299
10년 전 조회 355
10년 전 조회 370
10년 전 조회 788
10년 전 조회 479
10년 전 조회 486
10년 전 조회 524
10년 전 조회 491
10년 전 조회 717
10년 전 조회 583
10년 전 조회 521
10년 전 조회 517
10년 전 조회 515
10년 전 조회 507
10년 전 조회 435
10년 전 조회 913
10년 전 조회 418
10년 전 조회 447
10년 전 조회 670
10년 전 조회 444
10년 전 조회 511
10년 전 조회 366
10년 전 조회 629
10년 전 조회 446
10년 전 조회 395
10년 전 조회 402
10년 전 조회 1,072
10년 전 조회 456
10년 전 조회 453
10년 전 조회 426
10년 전 조회 578
10년 전 조회 1,020
10년 전 조회 610
10년 전 조회 457
10년 전 조회 405
10년 전 조회 433
10년 전 조회 483
10년 전 조회 416
10년 전 조회 483
10년 전 조회 395
10년 전 조회 535
🐛 버그신고