Extension talk:Send2StatusNet

Latest comment: 9 years ago by Erkan Yilmaz in topic Bug: Empty page after uploading an image

if you want to help... edit

some improvements for the future could be:

  • try it out with your MediaWiki / StatusNet / GNU social version + add your results
  • translate (see Send2StatusNet.i18n.php, there's: en, de, fr already)
  • restrict msgs to certain pages/user(s)/edits
  • check for message length + treat/cut text in a better way
  • other url shorteners
  • things to do for 2.x:
    • enable "Notify StatusNet site every time you edit" again
    • file uploads should send the correct info to SN/GS (see here)
    • test in MW 1.19.x (which is still supported until 2015 May by WMF)
    • fix the header in the options (shows: <prefs-send2sn>)
    • rename extension to send2GNUsocial
(will do this when I have updated SN/identica references inside the code), --Erkan Yilmaz (talk) 11:48, 2 August 2014 (UTC)Reply

ur1.ca down edit

Hi, currently ur1.ca as short URL service is down and has been very slow in the last time. Therefore I set up another Short URL service, is.gd, as fast workaround.

As example I changed function ShortenLongUrlWithUr1dotca beginning in line 93 from Send2StatusNet.php to the following (it works for me).

function ShortenLongUrlWithUr1dotca ( $articleurl ) {
        // create a short url of the article link ( $shortlink ) using the http://is.gd service
        $ch = curl_init();
        $timeout = 5;
        $shortenerurl = 'http://is.gd/create.php?format=simple&url=';
        curl_setopt( $ch, CURLOPT_URL, $shortenerurl . $articleurl );
        curl_setopt($ch, CURLOPT_POST, 0);
        curl_setopt($ch, CURLOPT_FOLLOWLOCATION , 1);
        curl_setopt($ch, CURLOPT_HEADER, 0);  // DO NOT RETURN HTTP HEADERS
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);  // RETURN THE CONTENTS OF THE CALL
        curl_setopt( $ch, CURLOPT_CONNECTTIMEOUT, $timeout );
        $rawshortlinkoutput = curl_exec( $ch );
        curl_close( $ch );

        if (preg_match('/^http/', $rawshortlinkoutput)) {
                return strval($rawshortlinkoutput);
                }
}

--Singlespeedfahrer 19:21, 14 October 2011 (UTC)Reply

BTW: @Erkan Yilmaz, thanks for this extension. --Singlespeedfahrer 19:24, 14 October 2011 (UTC)Reply
Thanks for noticing + the code
version 1.3.2 includes the fix (by allowing in options to set one of the two URL shorteners), --Erkan Yilmaz 21:34, 14 October 2011 (UTC)Reply

Send messages to groups edit

I think it would be a good feature if it would be possible to send messages directly to one or more specific groups when this is selected in preferences. --Singlespeedfahrer 19:37, 15 October 2011 (UTC)Reply
  Done in v2.0.0, see input field "add this text to the end", --Erkan Yilmaz (talk) 01:42, 2 August 2014 (UTC)Reply

Bug: Empty page after uploading an image edit

After uploading an image an empty page is shown. Images still have been uploaded. Found this on my error.log:

PHP Fatal error: Call to a member function getContent() on a non-object in /var/www/mediawiki/extensions/Send2StatusNet/Send2StatusNet.php on line 186, referer: hxx://xxxx.xx/wiki/Spezial:Hochladen

Singlespeedfahrer 21:27, 22 October 2011 (UTC)Reply

Fixed it with the check that no special page will be sent in Send2StatusNet.php (line 175 and 232). Therefore uploading an image is not send to the StatusNet site. Changed line 175 to:
if ( $wgUser->getBoolOption('SendToStatusNetActivate') && $wgUser->getBoolOption('SendToIdenticaNewArticles') && $wgTitle->getNamespace() != NS_SPECIAL ) {
and line 232 to:
if ( $wgUser->getBoolOption('SendToStatusNetActivate') && $wgUser->getBoolOption('SendToIdenticaNewArticles') && $wgTitle->getNamespace() != NS_SPECIAL ) { 
--Singlespeedfahrer 18:03, 17 November 2011 (UTC)Reply
checked with 2.0.0 version (in MW 1.23.2):
File upload works without errors, but: s2sn ends the wrong info (links to Special:Upload instead of file) :-( So, another todo I'll add above. --Erkan Yilmaz (talk) 12:50, 2 August 2014 (UTC)Reply
Return to "Send2StatusNet" page.