pushbullet 푸시 발송

· 10년 전 · 660

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년 전 조회 368
9년 전 조회 286
9년 전 조회 405
9년 전 조회 340
9년 전 조회 272
9년 전 조회 242
9년 전 조회 291
9년 전 조회 236
9년 전 조회 276
9년 전 조회 299
9년 전 조회 240
9년 전 조회 295
9년 전 조회 253
9년 전 조회 367
9년 전 조회 454
9년 전 조회 411
10년 전 조회 362
10년 전 조회 321
10년 전 조회 367
10년 전 조회 308
10년 전 조회 338
10년 전 조회 291
10년 전 조회 260
10년 전 조회 270
10년 전 조회 302
10년 전 조회 361
10년 전 조회 329
10년 전 조회 381
10년 전 조회 303
10년 전 조회 303
10년 전 조회 305
10년 전 조회 337
10년 전 조회 426
10년 전 조회 534
10년 전 조회 317
10년 전 조회 377
10년 전 조회 317
10년 전 조회 226
10년 전 조회 243
10년 전 조회 440
10년 전 조회 292
10년 전 조회 285
10년 전 조회 280
10년 전 조회 423
10년 전 조회 450
10년 전 조회 951
10년 전 조회 335
10년 전 조회 408
10년 전 조회 317
10년 전 조회 661
10년 전 조회 405
10년 전 조회 369
10년 전 조회 404
10년 전 조회 302
10년 전 조회 527
10년 전 조회 432
10년 전 조회 264
10년 전 조회 348
10년 전 조회 502
10년 전 조회 238
10년 전 조회 266
10년 전 조회 295
10년 전 조회 707
10년 전 조회 400
10년 전 조회 399
10년 전 조회 476
10년 전 조회 412
10년 전 조회 633
10년 전 조회 496
10년 전 조회 434
10년 전 조회 458
10년 전 조회 440
10년 전 조회 418
10년 전 조회 352
10년 전 조회 823
10년 전 조회 341
10년 전 조회 376
10년 전 조회 584
10년 전 조회 366
10년 전 조회 434
10년 전 조회 282
10년 전 조회 529
10년 전 조회 370
10년 전 조회 347
10년 전 조회 350
10년 전 조회 1,002
10년 전 조회 389
10년 전 조회 376
10년 전 조회 365
10년 전 조회 499
10년 전 조회 946
10년 전 조회 531
10년 전 조회 379
10년 전 조회 339
10년 전 조회 353
10년 전 조회 419
10년 전 조회 337
10년 전 조회 402
10년 전 조회 324
10년 전 조회 470
🐛 버그신고