forked from friendica/deprecated-addons
Removed many deprecated addons
This commit is contained in:
parent
8ea198a97e
commit
1b7283c72b
247 changed files with 28554 additions and 0 deletions
58
posterous/lang/C/messages.po
Normal file
58
posterous/lang/C/messages.po
Normal file
|
@ -0,0 +1,58 @@
|
|||
# ADDON posterous
|
||||
# Copyright (C)
|
||||
# This file is distributed under the same license as the Friendica posterous addon package.
|
||||
#
|
||||
#
|
||||
#, fuzzy
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: \n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2013-02-27 05:01-0500\n"
|
||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||
"Language: \n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
|
||||
#: posterous.php:37
|
||||
msgid "Post to Posterous"
|
||||
msgstr ""
|
||||
|
||||
#: posterous.php:70
|
||||
msgid "Posterous Post Settings"
|
||||
msgstr ""
|
||||
|
||||
#: posterous.php:72
|
||||
msgid "Enable Posterous Post Plugin"
|
||||
msgstr ""
|
||||
|
||||
#: posterous.php:77
|
||||
msgid "Posterous login"
|
||||
msgstr ""
|
||||
|
||||
#: posterous.php:82
|
||||
msgid "Posterous password"
|
||||
msgstr ""
|
||||
|
||||
#: posterous.php:87
|
||||
msgid "Posterous site ID"
|
||||
msgstr ""
|
||||
|
||||
#: posterous.php:92
|
||||
msgid "Posterous API token"
|
||||
msgstr ""
|
||||
|
||||
#: posterous.php:97
|
||||
msgid "Post to Posterous by default"
|
||||
msgstr ""
|
||||
|
||||
#: posterous.php:103
|
||||
msgid "Submit"
|
||||
msgstr ""
|
||||
|
||||
#: posterous.php:189
|
||||
msgid "Post from Friendica"
|
||||
msgstr ""
|
12
posterous/lang/ca/strings.php
Normal file
12
posterous/lang/ca/strings.php
Normal file
|
@ -0,0 +1,12 @@
|
|||
<?php
|
||||
|
||||
$a->strings["Post to Posterous"] = "enviament a Posterous";
|
||||
$a->strings["Posterous Post Settings"] = "Configuració d'Enviaments a Posterous";
|
||||
$a->strings["Enable Posterous Post Plugin"] = "Habilitar plugin d'Enviament de Posterous";
|
||||
$a->strings["Posterous login"] = "Inici de sessió a Posterous";
|
||||
$a->strings["Posterous password"] = "Contrasenya a Posterous";
|
||||
$a->strings["Posterous site ID"] = "ID al lloc Posterous";
|
||||
$a->strings["Posterous API token"] = "Posterous API token";
|
||||
$a->strings["Post to Posterous by default"] = "Enviar a Posterous per defecte";
|
||||
$a->strings["Submit"] = "Enviar";
|
||||
$a->strings["Post from Friendica"] = "Enviament des de Friendica";
|
12
posterous/lang/cs/strings.php
Normal file
12
posterous/lang/cs/strings.php
Normal file
|
@ -0,0 +1,12 @@
|
|||
<?php
|
||||
|
||||
$a->strings["Post to Posterous"] = "Poslat na Posterous";
|
||||
$a->strings["Posterous Post Settings"] = "Posterous nastavení příspěvků";
|
||||
$a->strings["Enable Posterous Post Plugin"] = "Umožnit Posterous Plugin";
|
||||
$a->strings["Posterous login"] = "Posterous login";
|
||||
$a->strings["Posterous password"] = "Posterous heslo";
|
||||
$a->strings["Posterous site ID"] = "Posterous site ID";
|
||||
$a->strings["Posterous API token"] = "Posterous API token";
|
||||
$a->strings["Post to Posterous by default"] = "Příspěvky standardně posílat na Posterous";
|
||||
$a->strings["Submit"] = "Odeslat";
|
||||
$a->strings["Post from Friendica"] = "Příspěvek z Friendica";
|
12
posterous/lang/de/strings.php
Normal file
12
posterous/lang/de/strings.php
Normal file
|
@ -0,0 +1,12 @@
|
|||
<?php
|
||||
|
||||
$a->strings["Post to Posterous"] = "Nach Posterous senden";
|
||||
$a->strings["Posterous Post Settings"] = "Posterous Beitrags-Einstellungen";
|
||||
$a->strings["Enable Posterous Post Plugin"] = "Posterous-Plugin aktivieren";
|
||||
$a->strings["Posterous login"] = "Posterous-Anmeldename";
|
||||
$a->strings["Posterous password"] = "Posterous-Passwort";
|
||||
$a->strings["Posterous site ID"] = "Posterous site ID";
|
||||
$a->strings["Posterous API token"] = "Posterous API token";
|
||||
$a->strings["Post to Posterous by default"] = "Veröffentliche öffentliche Beiträge standardmäßig bei Posterous";
|
||||
$a->strings["Submit"] = "Senden";
|
||||
$a->strings["Post from Friendica"] = "Beitrag via Friendica";
|
12
posterous/lang/eo/strings.php
Normal file
12
posterous/lang/eo/strings.php
Normal file
|
@ -0,0 +1,12 @@
|
|||
<?php
|
||||
|
||||
$a->strings["Post to Posterous"] = "Afiŝi al Posterous";
|
||||
$a->strings["Posterous Post Settings"] = "Agordoj pri afiŝoj ĉe Posterous";
|
||||
$a->strings["Enable Posterous Post Plugin"] = "Ŝalti la Poserous-afiŝo kromprogramon";
|
||||
$a->strings["Posterous login"] = "Posterous salutnomo";
|
||||
$a->strings["Posterous password"] = "Posterous pasvorto";
|
||||
$a->strings["Posterous site ID"] = "Idento de Posterous retejo";
|
||||
$a->strings["Posterous API token"] = "API ĵetono de Posterous retejo";
|
||||
$a->strings["Post to Posterous by default"] = "Defaŭlte afiŝi al Posterous";
|
||||
$a->strings["Submit"] = "Sendi";
|
||||
$a->strings["Post from Friendica"] = "Afiŝo de Friendica";
|
12
posterous/lang/es/strings.php
Normal file
12
posterous/lang/es/strings.php
Normal file
|
@ -0,0 +1,12 @@
|
|||
<?php
|
||||
|
||||
$a->strings["Post to Posterous"] = "Publicar en Posterous";
|
||||
$a->strings["Posterous Post Settings"] = "Configuración de las publicaciones en Posterous";
|
||||
$a->strings["Enable Posterous Post Plugin"] = "Activar el módulo de publicación en Posterous";
|
||||
$a->strings["Posterous login"] = "Entrar en Posterous";
|
||||
$a->strings["Posterous password"] = "Contraseña de Posterous";
|
||||
$a->strings["Posterous site ID"] = "ID de Posterous";
|
||||
$a->strings["Posterous API token"] = "API de Posterous";
|
||||
$a->strings["Post to Posterous by default"] = "Publicar en Posterous por defecto";
|
||||
$a->strings["Submit"] = "Envíar";
|
||||
$a->strings["Post from Friendica"] = "Publicado desde Friendica";
|
12
posterous/lang/fr/strings.php
Normal file
12
posterous/lang/fr/strings.php
Normal file
|
@ -0,0 +1,12 @@
|
|||
<?php
|
||||
|
||||
$a->strings["Post to Posterous"] = "Envoyer à Posterous";
|
||||
$a->strings["Posterous Post Settings"] = "Réglages de l'envoi à Posterous";
|
||||
$a->strings["Enable Posterous Post Plugin"] = "Activer l'envoi à Posterous";
|
||||
$a->strings["Posterous login"] = "Login Posterous";
|
||||
$a->strings["Posterous password"] = "Mot de passe";
|
||||
$a->strings["Posterous site ID"] = "ID du site Posterous";
|
||||
$a->strings["Posterous API token"] = "Clé d'API Posterous";
|
||||
$a->strings["Post to Posterous by default"] = "Envoyer à Posterous par défaut";
|
||||
$a->strings["Submit"] = "Envoyer";
|
||||
$a->strings["Post from Friendica"] = "Publier depuis Friendica";
|
12
posterous/lang/is/strings.php
Normal file
12
posterous/lang/is/strings.php
Normal file
|
@ -0,0 +1,12 @@
|
|||
<?php
|
||||
|
||||
$a->strings["Post to Posterous"] = "Senda færslu á Posterous";
|
||||
$a->strings["Posterous Post Settings"] = "Stilla Posterous Post";
|
||||
$a->strings["Enable Posterous Post Plugin"] = "Kveðja á Posterous Post viðbót ";
|
||||
$a->strings["Posterous login"] = "Posterous notendanafn";
|
||||
$a->strings["Posterous password"] = "Posterous aðgangsorð";
|
||||
$a->strings["Posterous site ID"] = "";
|
||||
$a->strings["Posterous API token"] = "";
|
||||
$a->strings["Post to Posterous by default"] = "Sjálfgefið láta færslur flæða á Posterous";
|
||||
$a->strings["Submit"] = "Senda inn";
|
||||
$a->strings["Post from Friendica"] = "Færslur frá Friendica";
|
12
posterous/lang/it/strings.php
Normal file
12
posterous/lang/it/strings.php
Normal file
|
@ -0,0 +1,12 @@
|
|||
<?php
|
||||
|
||||
$a->strings["Post to Posterous"] = "Invia a Posterous";
|
||||
$a->strings["Posterous Post Settings"] = "Impostazioni di invio a Posterous";
|
||||
$a->strings["Enable Posterous Post Plugin"] = "Abilita il plugin di invio a Posterous";
|
||||
$a->strings["Posterous login"] = "Posterous login";
|
||||
$a->strings["Posterous password"] = "Posterous password";
|
||||
$a->strings["Posterous site ID"] = "";
|
||||
$a->strings["Posterous API token"] = "";
|
||||
$a->strings["Post to Posterous by default"] = "Invia sempre a Posterous";
|
||||
$a->strings["Submit"] = "Invia";
|
||||
$a->strings["Post from Friendica"] = "Messaggio da Friendica";
|
12
posterous/lang/nb-no/strings.php
Normal file
12
posterous/lang/nb-no/strings.php
Normal file
|
@ -0,0 +1,12 @@
|
|||
<?php
|
||||
|
||||
$a->strings["Post to Posterous"] = "";
|
||||
$a->strings["Posterous Post Settings"] = "";
|
||||
$a->strings["Enable Posterous Post Plugin"] = "";
|
||||
$a->strings["Posterous login"] = "";
|
||||
$a->strings["Posterous password"] = "";
|
||||
$a->strings["Posterous site ID"] = "";
|
||||
$a->strings["Posterous API token"] = "";
|
||||
$a->strings["Post to Posterous by default"] = "";
|
||||
$a->strings["Submit"] = "Lagre";
|
||||
$a->strings["Post from Friendica"] = "";
|
12
posterous/lang/pl/strings.php
Normal file
12
posterous/lang/pl/strings.php
Normal file
|
@ -0,0 +1,12 @@
|
|||
<?php
|
||||
|
||||
$a->strings["Post to Posterous"] = "";
|
||||
$a->strings["Posterous Post Settings"] = "";
|
||||
$a->strings["Enable Posterous Post Plugin"] = "";
|
||||
$a->strings["Posterous login"] = "";
|
||||
$a->strings["Posterous password"] = "";
|
||||
$a->strings["Posterous site ID"] = "";
|
||||
$a->strings["Posterous API token"] = "";
|
||||
$a->strings["Post to Posterous by default"] = "";
|
||||
$a->strings["Submit"] = "Potwierdź";
|
||||
$a->strings["Post from Friendica"] = "Post z Friendica";
|
12
posterous/lang/pt-br/strings.php
Normal file
12
posterous/lang/pt-br/strings.php
Normal file
|
@ -0,0 +1,12 @@
|
|||
<?php
|
||||
|
||||
$a->strings["Post to Posterous"] = "Postar no Posterous";
|
||||
$a->strings["Posterous Post Settings"] = "Configurações de Postagem do Posterous";
|
||||
$a->strings["Enable Posterous Post Plugin"] = "Habilitar Plugin de Postagem do Posterous";
|
||||
$a->strings["Posterous login"] = "Login do Posterous";
|
||||
$a->strings["Posterous password"] = "Senha do Posterous";
|
||||
$a->strings["Posterous site ID"] = "";
|
||||
$a->strings["Posterous API token"] = "";
|
||||
$a->strings["Post to Posterous by default"] = "Postar para o Posterous como padrão";
|
||||
$a->strings["Submit"] = "Enviar";
|
||||
$a->strings["Post from Friendica"] = "Postar do Friendica";
|
12
posterous/lang/ru/strings.php
Normal file
12
posterous/lang/ru/strings.php
Normal file
|
@ -0,0 +1,12 @@
|
|||
<?php
|
||||
|
||||
$a->strings["Post to Posterous"] = "";
|
||||
$a->strings["Posterous Post Settings"] = "";
|
||||
$a->strings["Enable Posterous Post Plugin"] = "Включить Posterous плагин сообщений";
|
||||
$a->strings["Posterous login"] = "";
|
||||
$a->strings["Posterous password"] = "";
|
||||
$a->strings["Posterous site ID"] = "";
|
||||
$a->strings["Posterous API token"] = "";
|
||||
$a->strings["Post to Posterous by default"] = "";
|
||||
$a->strings["Submit"] = "Подтвердить";
|
||||
$a->strings["Post from Friendica"] = "Сообщение от Friendica";
|
3
posterous/lang/sv/strings.php
Normal file
3
posterous/lang/sv/strings.php
Normal file
|
@ -0,0 +1,3 @@
|
|||
<?php
|
||||
|
||||
$a->strings["Submit"] = "Spara";
|
12
posterous/lang/zh-cn/strings.php
Normal file
12
posterous/lang/zh-cn/strings.php
Normal file
|
@ -0,0 +1,12 @@
|
|||
<?php
|
||||
|
||||
$a->strings["Post to Posterous"] = "发送往Posterous";
|
||||
$a->strings["Posterous Post Settings"] = "Posterous发送设置";
|
||||
$a->strings["Enable Posterous Post Plugin"] = "使Posterous发送插件可用的";
|
||||
$a->strings["Posterous login"] = "Posterous登记名";
|
||||
$a->strings["Posterous password"] = "Posterous密码";
|
||||
$a->strings["Posterous site ID"] = "Posterous网站身份证明";
|
||||
$a->strings["Posterous API token"] = "Posterous API令牌";
|
||||
$a->strings["Post to Posterous by default"] = "默认地发送往Posterous";
|
||||
$a->strings["Submit"] = "提交";
|
||||
$a->strings["Post from Friendica"] = "文章从Friendica";
|
16
posterous/posterous.css
Executable file
16
posterous/posterous.css
Executable file
|
@ -0,0 +1,16 @@
|
|||
|
||||
#posterous-enable-label, #posterous-username-label, #posterous-password-label, #posterous-site_id-label, #posterous-api_token-label, #posterous-bydefault-label {
|
||||
float: left;
|
||||
width: 200px;
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
#posterous-checkbox, #posterous-username, #posterous-password, #posterous-site_id, #posterous-api_token, #posterous-bydefault {
|
||||
float: left;
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
#posterous-submit {
|
||||
margin-top: 15px;
|
||||
}
|
||||
|
215
posterous/posterous.php
Executable file
215
posterous/posterous.php
Executable file
|
@ -0,0 +1,215 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* Name: Posterous Post Connector
|
||||
* Description: Post to Posterous accounts
|
||||
* Version: 1.0
|
||||
* Author: Mike Macgirvin <http://macgirvin.com/profile/mike>
|
||||
* Author: Tony Baldwin <https://free-haven.org/u/tony>
|
||||
* Status: Unsupported
|
||||
*/
|
||||
|
||||
function posterous_install() {
|
||||
register_hook('post_local', 'addon/posterous/posterous.php', 'posterous_post_local');
|
||||
register_hook('notifier_normal', 'addon/posterous/posterous.php', 'posterous_send');
|
||||
register_hook('jot_networks', 'addon/posterous/posterous.php', 'posterous_jot_nets');
|
||||
register_hook('connector_settings', 'addon/posterous/posterous.php', 'posterous_settings');
|
||||
register_hook('connector_settings_post', 'addon/posterous/posterous.php', 'posterous_settings_post');
|
||||
|
||||
}
|
||||
function posterous_uninstall() {
|
||||
unregister_hook('post_local', 'addon/posterous/posterous.php', 'posterous_post_local');
|
||||
unregister_hook('notifier_normal', 'addon/posterous/posterous.php', 'posterous_send');
|
||||
unregister_hook('jot_networks', 'addon/posterous/posterous.php', 'posterous_jot_nets');
|
||||
unregister_hook('connector_settings', 'addon/posterous/posterous.php', 'posterous_settings');
|
||||
unregister_hook('connector_settings_post', 'addon/posterous/posterous.php', 'posterous_settings_post');
|
||||
}
|
||||
|
||||
|
||||
function posterous_jot_nets(&$a,&$b) {
|
||||
if(! local_user())
|
||||
return;
|
||||
|
||||
$pstr_post = get_pconfig(local_user(),'posterous','post');
|
||||
if(intval($pstr_post) == 1) {
|
||||
$pstr_defpost = get_pconfig(local_user(),'posterous','post_by_default');
|
||||
$selected = ((intval($pstr_defpost) == 1) ? ' checked="checked" ' : '');
|
||||
$b .= '<div class="profile-jot-net"><input type="checkbox" name="posterous_enable"' . $selected . ' value="1" /> '
|
||||
. t('Post to Posterous') . '</div>';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function posterous_settings(&$a,&$s) {
|
||||
|
||||
if(! local_user())
|
||||
return;
|
||||
|
||||
/* Add our stylesheet to the page so we can make our settings look nice */
|
||||
|
||||
$a->page['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="' . $a->get_baseurl() . '/addon/posterous/posterous.css' . '" media="all" />' . "\r\n";
|
||||
|
||||
/* Get the current state of our config variables */
|
||||
|
||||
$enabled = get_pconfig(local_user(),'posterous','post');
|
||||
|
||||
$checked = (($enabled) ? ' checked="checked" ' : '');
|
||||
|
||||
$def_enabled = get_pconfig(local_user(),'posterous','post_by_default');
|
||||
|
||||
$def_checked = (($def_enabled) ? ' checked="checked" ' : '');
|
||||
|
||||
$pstr_username = get_pconfig(local_user(), 'posterous', 'posterous_username');
|
||||
$pstr_password = get_pconfig(local_user(), 'posterous', 'posterous_password');
|
||||
$pstr_site_id = get_pconfig(local_user(), 'posterous', 'posterous_site_id');
|
||||
$pstr_api_token = get_pconfig(local_user(), 'posterous', 'posterous_api_token');
|
||||
|
||||
|
||||
/* Add some HTML to the existing form */
|
||||
|
||||
$s .= '<div class="settings-block">';
|
||||
$s .= '<h3>' . t('Posterous Post Settings') . '</h3>';
|
||||
$s .= '<div id="posterous-enable-wrapper">';
|
||||
$s .= '<label id="posterous-enable-label" for="posterous-checkbox">' . t('Enable Posterous Post Plugin') . '</label>';
|
||||
$s .= '<input id="posterous-checkbox" type="checkbox" name="posterous" value="1" ' . $checked . '/>';
|
||||
$s .= '</div><div class="clear"></div>';
|
||||
|
||||
$s .= '<div id="posterous-username-wrapper">';
|
||||
$s .= '<label id="posterous-username-label" for="posterous-username">' . t('Posterous login') . '</label>';
|
||||
$s .= '<input id="posterous-username" type="text" name="posterous_username" value="' . $pstr_username . '" />';
|
||||
$s .= '</div><div class="clear"></div>';
|
||||
|
||||
$s .= '<div id="posterous-password-wrapper">';
|
||||
$s .= '<label id="posterous-password-label" for="posterous-password">' . t('Posterous password') . '</label>';
|
||||
$s .= '<input id="posterous-password" type="password" name="posterous_password" value="' . $pstr_password . '" />';
|
||||
$s .= '</div><div class="clear"></div>';
|
||||
|
||||
$s .= '<div id="posterous-site_id-wrapper">';
|
||||
$s .= '<label id="posterous-site_id-label" for="posterous-site_id">' . t('Posterous site ID') . '</label>';
|
||||
$s .= '<input id="posterous-site_id" type="text" name="posterous_site_id" value="' . $pstr_site_id . '" />';
|
||||
$s .= '</div><div class="clear"></div>';
|
||||
|
||||
$s .= '<div id="posterous-api_token-wrapper">';
|
||||
$s .= '<label id="posterous-api_token-label" for="posterous-api_token">' . t('Posterous API token') . '</label>';
|
||||
$s .= '<input id="posterous-api_token" type="text" name="posterous_api_token" value="' . $pstr_api_token . '" />';
|
||||
$s .= '</div><div class="clear"></div>';
|
||||
|
||||
$s .= '<div id="posterous-bydefault-wrapper">';
|
||||
$s .= '<label id="posterous-bydefault-label" for="posterous-bydefault">' . t('Post to Posterous by default') . '</label>';
|
||||
$s .= '<input id="posterous-bydefault" type="checkbox" name="posterous_bydefault" value="1" ' . $def_checked . '/>';
|
||||
$s .= '</div><div class="clear"></div>';
|
||||
|
||||
/* provide a submit button */
|
||||
|
||||
$s .= '<div class="settings-submit-wrapper" ><input type="submit" id="posterous-submit" name="posterous-submit" class="settings-submit" value="' . t('Save Settings') . '" /></div></div>';
|
||||
|
||||
}
|
||||
|
||||
|
||||
function posterous_settings_post(&$a,&$b) {
|
||||
|
||||
if(x($_POST,'posterous-submit')) {
|
||||
|
||||
set_pconfig(local_user(),'posterous','post',intval($_POST['posterous']));
|
||||
set_pconfig(local_user(),'posterous','post_by_default',intval($_POST['posterous_bydefault']));
|
||||
set_pconfig(local_user(),'posterous','posterous_username',trim($_POST['posterous_username']));
|
||||
set_pconfig(local_user(),'posterous','posterous_password',trim($_POST['posterous_password']));
|
||||
set_pconfig(local_user(),'posterous','posterous_site_id',trim($_POST['posterous_site_id']));
|
||||
set_pconfig(local_user(),'posterous','posterous_api_token',trim($_POST['posterous_api_token']));
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function posterous_post_local(&$a,&$b) {
|
||||
|
||||
// This can probably be changed to allow editing by pointing to a different API endpoint
|
||||
|
||||
if($b['edit'])
|
||||
return;
|
||||
|
||||
if((! local_user()) || (local_user() != $b['uid']))
|
||||
return;
|
||||
|
||||
if($b['private'] || $b['parent'])
|
||||
return;
|
||||
|
||||
$pstr_post = intval(get_pconfig(local_user(),'posterous','post'));
|
||||
|
||||
$pstr_enable = (($pstr_post && x($_REQUEST,'posterous_enable')) ? intval($_REQUEST['posterous_enable']) : 0);
|
||||
|
||||
if($_REQUEST['api_source'] && intval(get_pconfig(local_user(),'posterous','post_by_default')))
|
||||
$pstr_enable = 1;
|
||||
|
||||
if(! $pstr_enable)
|
||||
return;
|
||||
|
||||
if(strlen($b['postopts']))
|
||||
$b['postopts'] .= ',';
|
||||
$b['postopts'] .= 'posterous';
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
function posterous_send(&$a,&$b) {
|
||||
|
||||
if($b['deleted'] || $b['private'] || ($b['created'] !== $b['edited']))
|
||||
return;
|
||||
|
||||
if(! strstr($b['postopts'],'posterous'))
|
||||
return;
|
||||
|
||||
if($b['parent'] != $b['id'])
|
||||
return;
|
||||
|
||||
|
||||
$pstr_username = get_pconfig($b['uid'],'posterous','posterous_username');
|
||||
$pstr_password = get_pconfig($b['uid'],'posterous','posterous_password');
|
||||
$pstr_site_id = get_pconfig($b['uid'],'posterous','posterous_site_id');
|
||||
$pstr_blog = "http://posterous.com/api/2/sites/$pstr_site_id/posts";
|
||||
$pstr_api_token = get_pconfig($b['uid'],'posterous','posterous_api_token');
|
||||
|
||||
if($pstr_username && $pstr_password && $pstr_blog) {
|
||||
|
||||
require_once('include/bbcode.php');
|
||||
$tag_arr = array();
|
||||
$tags = '';
|
||||
$x = preg_match_all('/\#\[(.*?)\](.*?)\[/',$b['tag'],$matches,PREG_SET_ORDER);
|
||||
|
||||
if($x) {
|
||||
foreach($matches as $mtch) {
|
||||
$tag_arr[] = $mtch[2];
|
||||
}
|
||||
}
|
||||
if(count($tag_arr))
|
||||
$tags = implode(',',$tag_arr);
|
||||
|
||||
|
||||
$params = array(
|
||||
'post[title]' => (($b['title']) ? $b['title'] : t('Post from Friendica')),
|
||||
'post[source]' => 'Friendica',
|
||||
'post[tags]' => $tags,
|
||||
'post[body]' => bbcode($b['body']),
|
||||
'api_token' => $pstr_api_token,
|
||||
'site_id' => $pstr_site_id
|
||||
);
|
||||
|
||||
$ch = curl_init();
|
||||
curl_setopt($ch, CURLOPT_URL, $pstr_blog);
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
|
||||
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5);
|
||||
curl_setopt($ch, CURLOPT_HEADER, false);
|
||||
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
|
||||
curl_setopt($ch, CURLOPT_USERPWD, $pstr_username . ':' . $pstr_password);
|
||||
curl_setopt($ch, CURLOPT_POST, true);
|
||||
curl_setopt($ch, CURLOPT_POSTFIELDS, $params);
|
||||
|
||||
$data = curl_exec($ch);
|
||||
$result = curl_multi_getcontent($ch);
|
||||
curl_close($ch);
|
||||
|
||||
logger('posterous_send: ' . $result);
|
||||
}
|
||||
}
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue