mirror of
https://git.friendi.ca/friendica/friendica-addons.git
synced 2024-11-25 20:23:17 +00:00
fbpost: videos are now posted as links
This commit is contained in:
parent
de8a7f88ce
commit
f9c2e64c8f
1 changed files with 14 additions and 4 deletions
|
@ -615,10 +615,11 @@ function fbpost_post_hook(&$a,&$b) {
|
||||||
|
|
||||||
logger('Facebook post: msg=' . $msg, LOGGER_DATA);
|
logger('Facebook post: msg=' . $msg, LOGGER_DATA);
|
||||||
|
|
||||||
|
$video = "";
|
||||||
|
|
||||||
if($likes) {
|
if($likes) {
|
||||||
$postvars = array('access_token' => $fb_token);
|
$postvars = array('access_token' => $fb_token);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
// message, picture, link, name, caption, description, source, place, tags
|
// message, picture, link, name, caption, description, source, place, tags
|
||||||
$postvars = array(
|
$postvars = array(
|
||||||
'access_token' => $fb_token,
|
'access_token' => $fb_token,
|
||||||
|
@ -630,9 +631,8 @@ function fbpost_post_hook(&$a,&$b) {
|
||||||
if(trim($link) != "") {
|
if(trim($link) != "") {
|
||||||
$postvars['link'] = $link;
|
$postvars['link'] = $link;
|
||||||
|
|
||||||
// The following doesn't work - why?
|
|
||||||
if ((stristr($link,'youtube')) || (stristr($link,'youtu.be')) || (stristr($link,'vimeo'))) {
|
if ((stristr($link,'youtube')) || (stristr($link,'youtu.be')) || (stristr($link,'vimeo'))) {
|
||||||
$postvars['source'] = $link;
|
$video = $link;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(trim($linkname) != "")
|
if(trim($linkname) != "")
|
||||||
|
@ -658,6 +658,16 @@ function fbpost_post_hook(&$a,&$b) {
|
||||||
|
|
||||||
if($reply) {
|
if($reply) {
|
||||||
$url = 'https://graph.facebook.com/' . $reply . '/' . (($likes) ? 'likes' : 'comments');
|
$url = 'https://graph.facebook.com/' . $reply . '/' . (($likes) ? 'likes' : 'comments');
|
||||||
|
} else if (($video != "")) {
|
||||||
|
// If it is a link to a video then post it as a link
|
||||||
|
$postvars = array(
|
||||||
|
'access_token' => $fb_token,
|
||||||
|
'link' => $video,
|
||||||
|
);
|
||||||
|
if ($msg != $video)
|
||||||
|
$postvars['message'] = $msg;
|
||||||
|
|
||||||
|
$url = 'https://graph.facebook.com/'.$target.'/links';
|
||||||
} else if (($link == "") and ($image != "")) {
|
} else if (($link == "") and ($image != "")) {
|
||||||
// If it is only an image without a page link then post this image as a photo
|
// If it is only an image without a page link then post this image as a photo
|
||||||
$postvars = array(
|
$postvars = array(
|
||||||
|
|
Loading…
Reference in a new issue