New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

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

Comments

Projects
None yet
6 participants
@alexmuller

This comment has been minimized.

Show comment
Hide comment
@alexmuller

alexmuller Nov 8, 2017

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.

Contributor

alexmuller commented Nov 8, 2017

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

This comment has been minimized.

Show comment
Hide comment
@RobThree

RobThree 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).

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

This comment has been minimized.

Show comment
Hide comment
@sburlot

sburlot 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.

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

This comment has been minimized.

Show comment
Hide comment
@sr4136

sr4136 Feb 23, 2018

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

sr4136 commented Feb 23, 2018

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

@Albanj

This comment has been minimized.

Show comment
Hide comment
@Albanj

Albanj 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.

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

This comment has been minimized.

Show comment
Hide comment
@melissamcewen

melissamcewen 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';

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 join this conversation on GitHub. Already have an account? Sign in to comment