Skip to content
This repository has been archived by the owner on Sep 9, 2022. It is now read-only.

Does Tweetnest already support the new 280 characters tweet length? #91

Open
RobThree opened this issue Nov 8, 2017 · 6 comments
Open

Comments

@RobThree
Copy link

RobThree commented Nov 8, 2017

https://blog.twitter.com/official/en_us/topics/product/2017/tweetingmadeeasier.html

@alexmuller
Copy link
Contributor

It looks to me like the text column of the tn_tweets is set to VARCHAR(510). My MySQL is a little rusty but I think at least the database should be good up to 510 characters. I'm not sure why that number was chosen though.

@RobThree
Copy link
Author

RobThree commented Nov 8, 2017

Hmmm, my database is varchar(255); maybe an older version. I'll do some deeper digging when I get around to it (also to see what it takes to make Tweetnest support long(er) tweets if not already supported).

@sburlot
Copy link

sburlot commented Nov 17, 2017

I've made a quick hack to solve this temporarily:

  • Change the textcolumn of tn_tweetsto varchar(512) (if twitter changes the limit again...)
  • in the class.twitter.api.php file, replace (at the top):
		public $dbMap = array(
			"id_str"       => "tweetid",
			"created_at"   => "time",
			"text"         => "text",
			"source"       => "source",
			"coordinates"  => "coordinates",
			"geo"          => "geo",
			"place"        => "place",
			"contributors" => "contributors",
			"user.id"      => "userid"
		);

with

		public $dbMap = array(
			"id_str"       => "tweetid",
			"created_at"   => "time",
			"full_text"    => "text",
			"text"         => "text",
			"source"       => "source",
			"coordinates"  => "coordinates",
			"geo"          => "geo",
			"place"        => "place",
			"contributors" => "contributors",
			"user.id"      => "userid"
		);

I added a mapping between full_text to text because twitter returns the 280 chars tweets in the full_text field.

in the loadtweets.php file, line 127, add this line:

$params['tweet_mode'] = 'extended';
(before the
$data = $twitterApi->query('statuses/user_timeline', $params);
line)
so Twitter returns the extended tweets.

That's all.

EDIT: it appears I didnt run the upgrade.php script last time I updated TweetNest. The tweets field is now varchar(510)
EDIT2: My tables are prefixed with tn_, so make the changes for your config.

gothick added a commit to gothick/tweetnest that referenced this issue Nov 26, 2017
@sr4136
Copy link

sr4136 commented Feb 23, 2018

Any good suggestions for an easy way to re-import longer tweets that already got truncated?

@Albanj
Copy link

Albanj commented Feb 23, 2018

I deleted all messages directly in the mysql database between the 280’s Twitter update and the moment when I make the change.

@melissamcewen
Copy link

melissamcewen commented Mar 14, 2018

If you are like me and had an outdated version full of ..., you can just delete everything since the change and then load tweets. I tried targeting the character directly but unfortunately it doesn't reload them automatically (it looks for the most recent tweet and if it's there, won't load anymore). I didn't feel like modifying the code so I ran:

DELETE FROM `tn_tweets` WHERE `time` > '1509462910';

texttheater added a commit to texttheater/tweetnest that referenced this issue Mar 31, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants