Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#253 2013-08-08 10:00:37

philwareham
Core designer
From: Haslemere, Surrey, UK
Registered: 2009-06-11
Posts: 3,564
Website GitHub Mastodon

Re: TXP Tweet: arc_twitter and arc_twitter_intents

@NicolasGraph

What version of PHP are you running in MAMP? Then I’ll try to replicate the error as well.

Offline

#254 2013-08-08 15:01:14

maniqui
Member
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 3,070
Website

Re: TXP Tweet: arc_twitter and arc_twitter_intents

Mostly not related to any of the errors reported on this thread since the release of v4.0, below there is a diff of changes (fixes) that I made to my patched version (previous to the release of v4.0) that it seems that Andy didn’t port to v4.0. Not sure if he missed them, or if there was any good reason not to port them.

global $prefs,$txpcfg,$arc_twitter_consumerKey,$arc_twitter_consumerSecret;

 $arc_twitter = array();
@@ -156,9 +105,9 @@

   switch ($timeline) {
     case 'home': case 'friends':
-      $timeline = 'statuses/friends_timeline'; break;
+      $timeline = 'statuses/home_timeline'; break;
     case 'mentions':
-      $timeline = 'statuses/mentions'; break;
+      $timeline = 'statuses/mentions_timeline'; break;
     case 'user': default: $timeline = 'statuses/user_timeline';
   }

@@ -546,7 +495,7 @@
     $sql = "CREATE TABLE IF NOT EXISTS ".PFX."arc_twitter ";
     $sql.= "(arc_twitterid INTEGER AUTO_INCREMENT PRIMARY KEY,
         article_id INTEGER(11),
-        tweet_id BIGINT(20),
+        tweet_id VARCHAR(100),
         tweet VARCHAR(140),
         tinyurl VARCHAR(30));";

@@ -695,7 +644,7 @@
           ),
           'arc_twitter_suffix' => array(
             'label' => 'Tweet suffix',
-            'value' => $prefix
+            'value' => $suffix
           ),
           'arc_twitter_tweet_default' => array(
             'label' => 'Tweet articles by default',
@@ -891,11 +840,10 @@

         $id = strip_tags(gps('id'));
         if ($id) {
-            $twit->delete('statuses/destroy'.$id);
+            $twit->delete('statuses/destroy/'.$id);
             safe_delete('arc_twitter',"tweet_id = $id");
-        }
-
         pagetop('Twitter','Twitter updated');
+        }

     } else {

@@ -944,7 +892,7 @@
         $out.= tr(td($date,'span')
             .td(arc_Twitter::makeLinks(htmlentities($tweet->text
                 , ENT_QUOTES,'UTF-8')))
-            .td(dLink('arc_admin_twitter','delete','id',$tweet->id,''))
+            .td(dLink('arc_admin_twitter','delete','id',$tweet->id_str,''))
             );
     }

@@ -1083,7 +1031,7 @@
                 , $prefs['arc_twitter_accessTokenSecret']);
             $result = $twit->post('statuses/update', array('status' => $tweet));

-            $tweet_id = (is_object($result)) ? $result[0]->id : 0;
+            $tweet_id = (is_object($result)) ? $result->id_str : 0;

             if ($tweet_id) {

@@ -2448,499 +2396,3 @@
     return implode('&', $pairs);
   }
 }

It fixes:

  • changes in the API URLs (friends_timeline > home_timeline, mentions > mentions_timeline, statuses/destroy > statuses/destroy/).
  • Tweet IDs saved now as a string (varchar(100)), as the API returns it as an string (this is related to the Tweetpocalypse).
  • a minor issue with the prefix/suffix functionality provided by the plugin.

The above is the output of command: diff -uw arc_twitter_v4.0.php arc_twitter_v3.3.1_patched.php. So, the lines marked with + are the ones I’ve changed/added
BTW, ignore the line numbers in the diff, as they won’t probably match yours (as I’m using the plugin from plugin_cache_dir, exported using the Bloke’s Plugin Composer).


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#255 2013-08-08 16:02:36

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: TXP Tweet: arc_twitter and arc_twitter_intents

maniqui wrote:

It fixes

Julián, Andy has made a git repository available for the plugin’s development and contributions. If Andy doesn’t find interest or time to manually patch the code base, the easiest way to merge the changes could be by a pull request.

Offline

#256 2013-08-08 17:53:01

maniqui
Member
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 3,070
Website

Re: TXP Tweet: arc_twitter and arc_twitter_intents

Oh, thanks Gocom. Totally missed there was a repository. Would have I known about it before, I’d have sent the patches as pull requests. Will look to send these changes as atomic patch when I’ve some time.


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#257 2013-08-09 14:21:56

NicolasGraph
Plugin Author
From: France
Registered: 2008-07-24
Posts: 860
Website

Re: TXP Tweet: arc_twitter and arc_twitter_intents

@philwareham

I’m using Mamp 1.8.4.

Last edited by NicolasGraph (2013-08-09 14:22:25)


Nicolas
Follow me on Twitter and GitHub!
Multiple edits are usually to correct my frenglish…

Offline

#258 2013-08-09 14:34:15

philwareham
Core designer
From: Haslemere, Surrey, UK
Registered: 2009-06-11
Posts: 3,564
Website GitHub Mastodon

Re: TXP Tweet: arc_twitter and arc_twitter_intents

@NicolasGraph

Sorry, I mean within MAMP, which version of PHP are you running. MAMP lets you choose a specific PHP version.

You can also find out PHP version by placing a info.php file in your site root and running it…

<?php phpinfo(); ?>

Offline

#259 2013-08-09 14:48:12

NicolasGraph
Plugin Author
From: France
Registered: 2008-07-24
Posts: 860
Website

Re: TXP Tweet: arc_twitter and arc_twitter_intents

It seems to be PHP Version 5.2.11.


Nicolas
Follow me on Twitter and GitHub!
Multiple edits are usually to correct my frenglish…

Offline

#260 2013-08-09 15:20:18

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: TXP Tweet: arc_twitter and arc_twitter_intents

NicolasGraph wrote:

It seems to be PHP Version 5.2.11.

You should have updated years ago, but that particular error is not related to your PHP version. The plugin just has errors.

Offline

#261 2013-09-04 16:28:32

NicolasGraph
Plugin Author
From: France
Registered: 2008-07-24
Posts: 860
Website

Re: TXP Tweet: arc_twitter and arc_twitter_intents

It’s coming online and I still have the same problem when I save articles.

Fatal error: Cannot use object of type stdClass as array in […]/textpattern/lib/txplib_misc.php(812) : eval()'d code on line 1035

Anyone?

Edit: this fix by Juliàn (in this previous post) works great (thanks!) :

-            $tweet_id = (is_object($result)) ? $result[0]->id : 0;
+            $tweet_id = (is_object($result)) ? $result->id_str : 0;

Last edited by NicolasGraph (2013-09-04 17:21:40)


Nicolas
Follow me on Twitter and GitHub!
Multiple edits are usually to correct my frenglish…

Offline

#262 2013-09-04 18:28:31

NicolasGraph
Plugin Author
From: France
Registered: 2008-07-24
Posts: 860
Website

Re: TXP Tweet: arc_twitter and arc_twitter_intents

I still have a small problem in the date encoding.
In french, “août” becomes “août” I know it’s about UTF-8 but… ???

Last edited by NicolasGraph (2013-09-04 18:28:48)


Nicolas
Follow me on Twitter and GitHub!
Multiple edits are usually to correct my frenglish…

Offline

#263 2013-11-27 22:51:40

monkeyninja
Plugin Author
From: Sheffield, UK
Registered: 2008-10-14
Posts: 239
Website

Re: TXP Tweet: arc_twitter and arc_twitter_intents

A new version of arc_twitter is available for download with some bug fixes. Sorry for the long delay in patching up the plugin. I haven’t forgotten it. In fact, I am working on a new feature so stay tuned.

Offline

#264 2013-11-30 09:52:08

adamr
Member
Registered: 2011-08-01
Posts: 10

Re: TXP Tweet: arc_twitter and arc_twitter_intents

Hi all, apologies if this has already been addressed but I’ve had a scan of the thread and can’t see it.

Tag error: <txp:arc_twitter etc etc /> -> Warning: file_put_contents(): Exclusive locks may only be set for regular files while parsing form None on page default

Anyone seen this before?

Offline

Board footer

Powered by FluxBB