pushbullet 푸시 발송

· 10년 전 · 826

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년 전 조회 525
9년 전 조회 460
9년 전 조회 562
9년 전 조회 501
9년 전 조회 437
9년 전 조회 400
9년 전 조회 451
9년 전 조회 392
10년 전 조회 439
10년 전 조회 466
10년 전 조회 395
10년 전 조회 446
10년 전 조회 407
10년 전 조회 512
10년 전 조회 615
10년 전 조회 572
10년 전 조회 521
10년 전 조회 449
10년 전 조회 538
10년 전 조회 459
10년 전 조회 494
10년 전 조회 440
10년 전 조회 421
10년 전 조회 423
10년 전 조회 454
10년 전 조회 522
10년 전 조회 477
10년 전 조회 539
10년 전 조회 454
10년 전 조회 470
10년 전 조회 463
10년 전 조회 500
10년 전 조회 593
10년 전 조회 687
10년 전 조회 472
10년 전 조회 541
10년 전 조회 461
10년 전 조회 393
10년 전 조회 399
10년 전 조회 574
10년 전 조회 461
10년 전 조회 446
10년 전 조회 437
10년 전 조회 592
10년 전 조회 599
10년 전 조회 1,109
10년 전 조회 499
10년 전 조회 570
10년 전 조회 481
10년 전 조회 827
10년 전 조회 549
10년 전 조회 531
10년 전 조회 508
10년 전 조회 455
10년 전 조회 703
10년 전 조회 606
10년 전 조회 430
10년 전 조회 518
10년 전 조회 652
10년 전 조회 373
10년 전 조회 426
10년 전 조회 445
10년 전 조회 879
10년 전 조회 558
10년 전 조회 560
10년 전 조회 589
10년 전 조회 573
10년 전 조회 797
10년 전 조회 663
10년 전 조회 616
10년 전 조회 609
10년 전 조회 606
10년 전 조회 588
10년 전 조회 524
10년 전 조회 998
10년 전 조회 507
10년 전 조회 534
10년 전 조회 752
10년 전 조회 528
10년 전 조회 588
10년 전 조회 448
10년 전 조회 723
10년 전 조회 532
10년 전 조회 475
10년 전 조회 466
10년 전 조회 1,168
10년 전 조회 546
10년 전 조회 541
10년 전 조회 500
10년 전 조회 667
10년 전 조회 1,103
10년 전 조회 701
10년 전 조회 548
10년 전 조회 488
10년 전 조회 526
10년 전 조회 577
10년 전 조회 513
10년 전 조회 575
10년 전 조회 495
10년 전 조회 638
🐛 버그신고