pushbullet 푸시 발송

· 10년 전 · 816

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년 전 조회 519
9년 전 조회 448
9년 전 조회 559
9년 전 조회 495
9년 전 조회 427
9년 전 조회 393
9년 전 조회 445
9년 전 조회 380
9년 전 조회 429
9년 전 조회 460
9년 전 조회 390
10년 전 조회 439
10년 전 조회 401
10년 전 조회 507
10년 전 조회 604
10년 전 조회 561
10년 전 조회 515
10년 전 조회 444
10년 전 조회 532
10년 전 조회 452
10년 전 조회 487
10년 전 조회 434
10년 전 조회 411
10년 전 조회 412
10년 전 조회 449
10년 전 조회 515
10년 전 조회 467
10년 전 조회 533
10년 전 조회 444
10년 전 조회 461
10년 전 조회 459
10년 전 조회 493
10년 전 조회 586
10년 전 조회 681
10년 전 조회 469
10년 전 조회 532
10년 전 조회 451
10년 전 조회 386
10년 전 조회 391
10년 전 조회 567
10년 전 조회 453
10년 전 조회 437
10년 전 조회 432
10년 전 조회 580
10년 전 조회 590
10년 전 조회 1,101
10년 전 조회 492
10년 전 조회 563
10년 전 조회 474
10년 전 조회 817
10년 전 조회 544
10년 전 조회 525
10년 전 조회 501
10년 전 조회 452
10년 전 조회 695
10년 전 조회 593
10년 전 조회 421
10년 전 조회 509
10년 전 조회 647
10년 전 조회 366
10년 전 조회 420
10년 전 조회 438
10년 전 조회 869
10년 전 조회 546
10년 전 조회 554
10년 전 조회 578
10년 전 조회 566
10년 전 조회 788
10년 전 조회 658
10년 전 조회 604
10년 전 조회 602
10년 전 조회 596
10년 전 조회 580
10년 전 조회 512
10년 전 조회 992
10년 전 조회 496
10년 전 조회 527
10년 전 조회 740
10년 전 조회 517
10년 전 조회 583
10년 전 조회 434
10년 전 조회 715
10년 전 조회 521
10년 전 조회 466
10년 전 조회 460
10년 전 조회 1,162
10년 전 조회 540
10년 전 조회 534
10년 전 조회 493
10년 전 조회 654
10년 전 조회 1,090
10년 전 조회 695
10년 전 조회 540
10년 전 조회 480
10년 전 조회 518
10년 전 조회 570
10년 전 조회 507
10년 전 조회 570
10년 전 조회 482
10년 전 조회 631
🐛 버그신고