Facebook to email

Facebook to email Commit Details

Date:2014-06-12 21:22:36 (5 years 5 months ago)
Author:Grégory Soutadé
Branch:master
Commit:1c75b31fc5af1bfc3c11feb8219b256eae8b52cb
Parents: 868a07eefdbe9481ffd51108e841a5ec8f824515
Message:Add CoteSud module

Changes:
Amodules/cotesud.php (full)
Mmodules/email.php (1 diff)
Mressources/f2email.css (1 diff)

File differences

modules/cotesud.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
<?php
/**
* Copyright 2014 Grégory Soutadé
*
* This file is part of f2email.
*
* f2email is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* f2email is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with f2email. If not, see <http://www.gnu.org/licenses/>.
*/
require_once "email.php";
class CoteSud extends Email
{
function getName() { return "CoteSud"; }
function getDescription() { return "Sends an email for each new notification that was created the current day between 7h am and 11h am"; }
function manageNotification($fb_object, $notification)
{
// Invalid after 12h am
if (date("H") > 12) return;
$cur_day = date("d");
$d = date_parse($notification["created_time"]);
// Today between 07h am and 11h am
if ($d["hour"] >= 07 && $d["hour"] <= 11 && $d["day"] == $cur_day)
parent::manageNotification($fb_object, $notification);
}
}
?>
modules/email.php
7070
7171
7272
73
74
75
76
77
78
79
80
81
82
8373
8474
8575
}
$message = '<html><body>From <a href="https://www.facebook.com/' . $notification["from"]["id"] . '">' . $notification["from"]["name"] . "</a> :<br/><br/>";
/* switch($notification["type"]) */
/* { */
/* case "video": */
/* case "photo": */
/* if (array_key_exists("message", $notification)) */
/* $message .= '<img src="' . str_replace("_s", "_n", $notification["picture"]) . '"/><br/>'; */
/* if (array_key_exists("caption", $notification)) */
/* $message .= $notification["caption"] . "<br/>"; */
/* break; */
/* } */
if (array_key_exists("picture", $notification))
$message .= '<img src="' . str_replace("_s", "_n", $notification["picture"]) . '"/><br/>';
ressources/f2email.css
121121
122122
123123
124
125
126
127
124128
a.title_link, a.title_link:visited, a.title_link:hover {
color:black;
text-decoration:none;
}
.remove {
display:inline;
}

Archive Download the corresponding diff file

Branches