pushbullet 푸시 발송

· 10년 전 · 686

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년 전 조회 404
9년 전 조회 331
9년 전 조회 448
9년 전 조회 379
9년 전 조회 311
9년 전 조회 284
9년 전 조회 334
9년 전 조회 281
9년 전 조회 318
9년 전 조회 345
9년 전 조회 278
9년 전 조회 337
9년 전 조회 294
9년 전 조회 406
9년 전 조회 490
10년 전 조회 450
10년 전 조회 399
10년 전 조회 353
10년 전 조회 410
10년 전 조회 348
10년 전 조회 371
10년 전 조회 331
10년 전 조회 294
10년 전 조회 301
10년 전 조회 333
10년 전 조회 402
10년 전 조회 366
10년 전 조회 414
10년 전 조회 346
10년 전 조회 336
10년 전 조회 345
10년 전 조회 378
10년 전 조회 467
10년 전 조회 566
10년 전 조회 355
10년 전 조회 406
10년 전 조회 351
10년 전 조회 260
10년 전 조회 278
10년 전 조회 467
10년 전 조회 327
10년 전 조회 319
10년 전 조회 308
10년 전 조회 463
10년 전 조회 478
10년 전 조회 983
10년 전 조회 362
10년 전 조회 437
10년 전 조회 343
10년 전 조회 687
10년 전 조회 423
10년 전 조회 396
10년 전 조회 422
10년 전 조회 326
10년 전 조회 548
10년 전 조회 459
10년 전 조회 287
10년 전 조회 373
10년 전 조회 530
10년 전 조회 256
10년 전 조회 293
10년 전 조회 316
10년 전 조회 733
10년 전 조회 424
10년 전 조회 424
10년 전 조회 492
10년 전 조회 441
10년 전 조회 665
10년 전 조회 526
10년 전 조회 470
10년 전 조회 480
10년 전 조회 463
10년 전 조회 445
10년 전 조회 378
10년 전 조회 848
10년 전 조회 358
10년 전 조회 400
10년 전 조회 605
10년 전 조회 387
10년 전 조회 454
10년 전 조회 306
10년 전 조회 554
10년 전 조회 390
10년 전 조회 364
10년 전 조회 364
10년 전 조회 1,020
10년 전 조회 404
10년 전 조회 395
10년 전 조회 385
10년 전 조회 516
10년 전 조회 976
10년 전 조회 549
10년 전 조회 396
10년 전 조회 360
10년 전 조회 374
10년 전 조회 437
10년 전 조회 357
10년 전 조회 418
10년 전 조회 340
10년 전 조회 484
🐛 버그신고