-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
48 lines (32 loc) · 1.15 KB
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<?php
// NEST SNAPPER
// ----------------------------------------------------------------------------
// Includes
require_once 'config.php';
require_once 'src/snapchat.php';
// ----------------------------------------------------------------------------
// Go!
// Log in:
$snapchat = new Snapchat(NEST_SNAPPER_USERNAME, NEST_SNAPPER_PASSWORD);
// Get your feed:
$snaps = $snapchat->getSnaps();
// ----------------------------------------------------------------------------
// Listing
header('Content-type: text/plain');
echo 'Looking for new snaps to forward. ';
foreach($snaps as $snap){
if($snap->status == 1 && $snap->recipient == NEST_SNAPPER_USERNAME){
// Download a snap:
$data = $snapchat->getMedia($snap->id);
// Mark the snap as viewed:
$snapchat->markSnapViewed($snap->id);
// Send
echo 'Sending snap from ' . $snap->sender . ' to ' . implode(', ', $nesters) . '...';
$id = $snapchat->upload(
Snapchat::MEDIA_IMAGE,
$data
);
$snapchat->send($id, $nesters, 8);
}
}
// ----------------------------------------------------------------------------