pushbullet 푸시 발송

· 10년 전 · 795

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년 전 조회 496
9년 전 조회 418
9년 전 조회 538
9년 전 조회 465
9년 전 조회 409
9년 전 조회 369
9년 전 조회 417
9년 전 조회 364
9년 전 조회 400
9년 전 조회 430
9년 전 조회 368
10년 전 조회 412
10년 전 조회 380
10년 전 조회 486
10년 전 조회 578
10년 전 조회 536
10년 전 조회 491
10년 전 조회 421
10년 전 조회 509
10년 전 조회 427
10년 전 조회 456
10년 전 조회 412
10년 전 조회 383
10년 전 조회 386
10년 전 조회 424
10년 전 조회 485
10년 전 조회 443
10년 전 조회 500
10년 전 조회 422
10년 전 조회 440
10년 전 조회 427
10년 전 조회 471
10년 전 조회 563
10년 전 조회 653
10년 전 조회 434
10년 전 조회 502
10년 전 조회 428
10년 전 조회 357
10년 전 조회 362
10년 전 조회 541
10년 전 조회 430
10년 전 조회 409
10년 전 조회 407
10년 전 조회 557
10년 전 조회 556
10년 전 조회 1,079
10년 전 조회 465
10년 전 조회 534
10년 전 조회 439
10년 전 조회 796
10년 전 조회 514
10년 전 조회 503
10년 전 조회 472
10년 전 조회 424
10년 전 조회 664
10년 전 조회 569
10년 전 조회 392
10년 전 조회 490
10년 전 조회 615
10년 전 조회 344
10년 전 조회 402
10년 전 조회 403
10년 전 조회 841
10년 전 조회 522
10년 전 조회 529
10년 전 조회 556
10년 전 조회 534
10년 전 조회 760
10년 전 조회 626
10년 전 조회 571
10년 전 조회 574
10년 전 조회 568
10년 전 조회 552
10년 전 조회 487
10년 전 조회 964
10년 전 조회 470
10년 전 조회 492
10년 전 조회 713
10년 전 조회 497
10년 전 조회 557
10년 전 조회 412
10년 전 조회 679
10년 전 조회 502
10년 전 조회 437
10년 전 조회 441
10년 전 조회 1,133
10년 전 조회 508
10년 전 조회 501
10년 전 조회 475
10년 전 조회 625
10년 전 조회 1,061
10년 전 조회 665
10년 전 조회 517
10년 전 조회 453
10년 전 조회 487
10년 전 조회 544
10년 전 조회 470
10년 전 조회 538
10년 전 조회 457
10년 전 조회 588
🐛 버그신고