Open RobThree opened 7 years ago
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.
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).
I've made a quick hack to solve this temporarily:
text
column of tn_tweets
to varchar(512) (if twitter changes the limit again...)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.
Any good suggestions for an easy way to re-import longer tweets that already got truncated?
I deleted all messages directly in the mysql database between the 280’s Twitter update and the moment when I make the change.
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';
https://blog.twitter.com/official/en_us/topics/product/2017/tweetingmadeeasier.html