pushbullet 푸시 발송

· 10년 전 · 777

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년 전 조회 488
9년 전 조회 406
9년 전 조회 525
9년 전 조회 458
9년 전 조회 393
9년 전 조회 355
9년 전 조회 410
9년 전 조회 354
9년 전 조회 389
9년 전 조회 415
9년 전 조회 356
10년 전 조회 401
10년 전 조회 369
10년 전 조회 472
10년 전 조회 569
10년 전 조회 520
10년 전 조회 480
10년 전 조회 408
10년 전 조회 495
10년 전 조회 415
10년 전 조회 447
10년 전 조회 401
10년 전 조회 372
10년 전 조회 371
10년 전 조회 408
10년 전 조회 477
10년 전 조회 428
10년 전 조회 488
10년 전 조회 408
10년 전 조회 423
10년 전 조회 418
10년 전 조회 457
10년 전 조회 546
10년 전 조회 642
10년 전 조회 427
10년 전 조회 482
10년 전 조회 410
10년 전 조회 341
10년 전 조회 349
10년 전 조회 528
10년 전 조회 413
10년 전 조회 393
10년 전 조회 386
10년 전 조회 543
10년 전 조회 544
10년 전 조회 1,068
10년 전 조회 449
10년 전 조회 518
10년 전 조회 427
10년 전 조회 778
10년 전 조회 498
10년 전 조회 486
10년 전 조회 462
10년 전 조회 410
10년 전 조회 643
10년 전 조회 549
10년 전 조회 373
10년 전 조회 470
10년 전 조회 607
10년 전 조회 327
10년 전 조회 384
10년 전 조회 390
10년 전 조회 827
10년 전 조회 508
10년 전 조회 517
10년 전 조회 549
10년 전 조회 520
10년 전 조회 751
10년 전 조회 619
10년 전 조회 558
10년 전 조회 554
10년 전 조회 551
10년 전 조회 538
10년 전 조회 468
10년 전 조회 943
10년 전 조회 454
10년 전 조회 480
10년 전 조회 701
10년 전 조회 477
10년 전 조회 546
10년 전 조회 396
10년 전 조회 668
10년 전 조회 481
10년 전 조회 425
10년 전 조회 430
10년 전 조회 1,114
10년 전 조회 493
10년 전 조회 488
10년 전 조회 461
10년 전 조회 609
10년 전 조회 1,048
10년 전 조회 650
10년 전 조회 502
10년 전 조회 440
10년 전 조회 476
10년 전 조회 535
10년 전 조회 456
10년 전 조회 524
10년 전 조회 435
10년 전 조회 579
🐛 버그신고