pushbullet 푸시 발송

· 10년 전 · 767

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년 전 조회 475
9년 전 조회 402
9년 전 조회 515
9년 전 조회 448
9년 전 조회 383
9년 전 조회 345
9년 전 조회 401
9년 전 조회 347
9년 전 조회 384
9년 전 조회 407
9년 전 조회 343
9년 전 조회 392
9년 전 조회 362
9년 전 조회 462
9년 전 조회 565
10년 전 조회 514
10년 전 조회 470
10년 전 조회 395
10년 전 조회 486
10년 전 조회 409
10년 전 조회 441
10년 전 조회 388
10년 전 조회 369
10년 전 조회 362
10년 전 조회 397
10년 전 조회 467
10년 전 조회 424
10년 전 조회 479
10년 전 조회 399
10년 전 조회 408
10년 전 조회 412
10년 전 조회 451
10년 전 조회 539
10년 전 조회 633
10년 전 조회 418
10년 전 조회 479
10년 전 조회 402
10년 전 조회 332
10년 전 조회 341
10년 전 조회 517
10년 전 조회 400
10년 전 조회 388
10년 전 조회 380
10년 전 조회 529
10년 전 조회 538
10년 전 조회 1,057
10년 전 조회 439
10년 전 조회 509
10년 전 조회 421
10년 전 조회 768
10년 전 조회 492
10년 전 조회 477
10년 전 조회 453
10년 전 조회 395
10년 전 조회 632
10년 전 조회 541
10년 전 조회 366
10년 전 조회 461
10년 전 조회 599
10년 전 조회 316
10년 전 조회 376
10년 전 조회 382
10년 전 조회 815
10년 전 조회 499
10년 전 조회 504
10년 전 조회 539
10년 전 조회 506
10년 전 조회 736
10년 전 조회 611
10년 전 조회 547
10년 전 조회 532
10년 전 조회 543
10년 전 조회 530
10년 전 조회 458
10년 전 조회 932
10년 전 조회 443
10년 전 조회 471
10년 전 조회 692
10년 전 조회 469
10년 전 조회 533
10년 전 조회 390
10년 전 조회 654
10년 전 조회 469
10년 전 조회 415
10년 전 조회 421
10년 전 조회 1,101
10년 전 조회 479
10년 전 조회 477
10년 전 조회 448
10년 전 조회 599
10년 전 조회 1,036
10년 전 조회 638
10년 전 조회 491
10년 전 조회 426
10년 전 조회 464
10년 전 조회 521
10년 전 조회 443
10년 전 조회 513
10년 전 조회 429
10년 전 조회 565
🐛 버그신고