pushbullet 푸시 발송

· 10년 전 · 802

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년 전 조회 504
9년 전 조회 432
9년 전 조회 545
9년 전 조회 476
9년 전 조회 414
9년 전 조회 377
9년 전 조회 426
9년 전 조회 374
9년 전 조회 412
9년 전 조회 441
9년 전 조회 376
10년 전 조회 421
10년 전 조회 389
10년 전 조회 494
10년 전 조회 588
10년 전 조회 543
10년 전 조회 501
10년 전 조회 427
10년 전 조회 512
10년 전 조회 435
10년 전 조회 464
10년 전 조회 418
10년 전 조회 395
10년 전 조회 398
10년 전 조회 437
10년 전 조회 494
10년 전 조회 450
10년 전 조회 511
10년 전 조회 430
10년 전 조회 446
10년 전 조회 436
10년 전 조회 480
10년 전 조회 569
10년 전 조회 661
10년 전 조회 441
10년 전 조회 515
10년 전 조회 434
10년 전 조회 366
10년 전 조회 368
10년 전 조회 546
10년 전 조회 434
10년 전 조회 423
10년 전 조회 412
10년 전 조회 565
10년 전 조회 570
10년 전 조회 1,087
10년 전 조회 473
10년 전 조회 546
10년 전 조회 450
10년 전 조회 803
10년 전 조회 521
10년 전 조회 506
10년 전 조회 483
10년 전 조회 434
10년 전 조회 676
10년 전 조회 576
10년 전 조회 398
10년 전 조회 495
10년 전 조회 626
10년 전 조회 349
10년 전 조회 410
10년 전 조회 413
10년 전 조회 849
10년 전 조회 530
10년 전 조회 538
10년 전 조회 567
10년 전 조회 547
10년 전 조회 774
10년 전 조회 640
10년 전 조회 581
10년 전 조회 583
10년 전 조회 579
10년 전 조회 562
10년 전 조회 494
10년 전 조회 971
10년 전 조회 478
10년 전 조회 507
10년 전 조회 719
10년 전 조회 506
10년 전 조회 565
10년 전 조회 420
10년 전 조회 690
10년 전 조회 508
10년 전 조회 447
10년 전 조회 450
10년 전 조회 1,138
10년 전 조회 520
10년 전 조회 513
10년 전 조회 481
10년 전 조회 633
10년 전 조회 1,072
10년 전 조회 676
10년 전 조회 525
10년 전 조회 461
10년 전 조회 500
10년 전 조회 554
10년 전 조회 483
10년 전 조회 544
10년 전 조회 465
10년 전 조회 602
🐛 버그신고