beaulebens / keyring-social-importers

A collection of importers which pull your content back from social networks, and into your own WordPress install.
32 stars 17 forks source link

Twitter: Importing RTs even with the option unchecked #8

Closed beaulebens closed 7 years ago

beaulebens commented 7 years ago

The Twitter importer seems to be importing retweets, even if the option is unchecked.

Originally reported here.

glueckpress commented 7 years ago

I fixed the RT issue with a hack on my site by inserting the following check here:

// Double-check for retweets, which shouldn't be included at all if we chose to skip them
if ( false == $this->get_option( 'include_rts', true ) && ! empty( $post->retweeted_status ) ) {
    continue;
}

Not sure if this is ideal, but it seems to fix the issue for me.

beaulebens commented 7 years ago

@glueckpress your approach will work, but I believe the fix I just committed to master handles it further up. It turns out you have to explicitly set include_rts to false in the request (not just exclude it) to make Twitter leave out retweets. Check it out, and please let me know if that works for you!

glueckpress commented 7 years ago

Awesome, installed the fixed master, works perfectly! Thanks!

beaulebens commented 7 years ago

Awesome, it'll be part of the next release. Thanks for confirming.