News:

Join the Facebook Fan Page.

Main Menu

Tweet Embed

Started by Antes, April 03, 2014, 12:59:47 PM

Previous topic - Next topic

Antes

Link to Mod

BBCode allows you to embed tweet with its ID. This modification uses Official API to embed your tweets.

Changelog


1.1.1
- Bug in admin panel caused by auto-embed (Thanks to margarett for fixing).
1.1
- Auto Embed feature added by NanoSector
1.0
- First release, only allows BBC Embed with [tweet][/tweet].

License: MIT
Project Home: https://github.com/Antes/TweetEmbed

Kimmie

Any screenshots available?

Antes

Added a screenshot to the first post.

makarenıo

installed but there is no embed icon how can we do

margarett

Just add the ID like [tweet]your_id_here[/tweet]
This MOD does not create a button to do it for you.

Quote
1.0
- First release, only allows BBC Embed with [tweet][/tweet]
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

MotRude

Adding a button would make it way better..

THE BRA1N

Exactly what code should be added in between the tags? I get nothing but - Invalid Tweet ID, no matter how many tweets and 'ids' from different persons I try to embed. Some coherent instructions as to how to use this mod would be most helpful.

margarett

Just the ID.

Eg:

[tweet]441377716848574464[/tweet]

Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

Antes

Because of my mid-term exams i had to left it at very basic level and the mod gave us (i mean me/suki/margarett) bit headache because of fetch issues & error logs. All the requests will be added to next version (Probably after 18th of this month).

ameo

Is this being improved ever gonna happen?
antechinus:
QuoteIf you are dying for a solution it may be wise to seek medical attention.
Get some Awesome Smileys for your forum

|±(ಠ_ಠ
)±|

Antes

Quote from: ameo on September 11, 2014, 05:43:51 PM
Is this being improved ever gonna happen?

Probably not, because I'm giving most of my time to SMF 2.1 development. Sorry :( I'll try to make some time to add button to editor.

Apllicmz

Nice Work
Good Mod
Update Portuguese Cod

<file name="$languagedir/Modifications.portuguese_pt.php" error="skip">
        <operation>
            <search position="end" />
            <add><![CDATA[// Tweet Embed
$txt['invalid_tweet'] = 'ID inv&aacute;lido do Tweet';
]]></add>
        </operation>
    </file>
    <file name="$languagedir/Modifications.portuguese_pt-utf8.php" error="skip">
        <operation>
            <search position="end" />
            <add><![CDATA[// Tweet Embed
$txt['invalid_tweet'] = 'ID inv&aacute;lido do Tweet';
]]></add>
        </operation>
    </file>



Antes

1.1
- Auto Embed feature added by NanoSector

:D

Paracelsus

Hi,

The MOD works fine, but I think there might be a bug somewhere, because after installing it the BBCode admin area just disappears (please see attached image). I get it back with all the bbcode options when I uninstall the MOD.

Burke ♞ Knight

I noticed that, too. However, I usually leave all selected anyway, so not an emergency issue for me.
Although, it does need to be fixed.

Paracelsus

It's this part that disables it:

// Embed Twitter Tweets.
$message = preg_replace("/https?:\/\/(www.)?twitter.com\/[a-zA-Z0-9_]+\/status\/(\d+)/i", "[tweet]$2[/tweet]", $message);

Antes

I'm aware of the issue, unfortunately I don't have any time to look for fix :( that line disables the auto-embed option.

margarett

Should be easy enough:
// Embed Twitter Tweets.
if (!empty($message))
$message = preg_replace("/https?:\/\/(www.)?twitter.com\/[a-zA-Z0-9_]+\/status\/(\d+)/i", "[tweet]$2[/tweet]", $message);
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

Antes

Thanks a lot :) I'm uploading 1.1.1.

luuuciano

Very nice mod! simple and efective
Tried the other one, finally we are using yours

KUDOS

No me agradan los foros que no te dejan borrar TU PROPIO usuario, como por ejemplo smfsimple.com.
E incluso te mandan emails no solicitados, de los cuales, quizá, no puedas escapar porque NO te dejan posibilidad a deshabilitarlos (a menos que NO te tengan en su lista negra).

Paracelsus

Perfect fix @margarett, thanks.  ;)

Paracelsus

Some of our users have noticed that after autoembedding a tweet the smilies that come afterwards don't parse anymore as they supposed to. Even enclosing the tweet around another bbcode tag doesn't work because it doesn't recognize the closing tag after the autoembedded tweet.

Douglas

Antes, if I can make a tiny suggestion... I'd love to use this Mod package, but only if two other methods were also available for the tweet BBC code.

Currently, you only allow for status ID to be used. Most people are not going to be savvy enough or want to strip out just the ID code.

If you could also build in support for:
[tweet]https://twitter.com/BearlyDoug/status/626549963024146433[/tweet]
[tweet]http://twitter.com/BearlyDoug/status/626549963024146433[/tweet]

(with and without the WWW), that would make this feature absolutely PERFECT.
Doug Hazard
* Full Stack (Web) Developer for The Catholic Diocese of Richmond
(20+ Diocesan sites, 130+ Church sites & 24 School sites)
* Sports Photographer and Media Personality
* CFB Historian
* Tech Admin for one 1M+ post, one 2M+ post and one 10M+ post sites (last two are powered by multiple servers)
* WordPress Developer (Junkie / Guru / Maven / whatever)

Antes

Modification has auto-embed option, just paste the link :)

Douglas

I did... got an invalid tweet ID warning for some reason. Let me re-install it.

EDIT: Attached two screenshots.

https://twitter.com/BadPhotoshopHog/status/626936027542867968 is the source URL used
Doug Hazard
* Full Stack (Web) Developer for The Catholic Diocese of Richmond
(20+ Diocesan sites, 130+ Church sites & 24 School sites)
* Sports Photographer and Media Personality
* CFB Historian
* Tech Admin for one 1M+ post, one 2M+ post and one 10M+ post sites (last two are powered by multiple servers)
* WordPress Developer (Junkie / Guru / Maven / whatever)

Antes

You don't need to use tweet tag with auto-embed option just paste the link.

Douglas

* Douglas facepalms himself

Can't believe it was *that* simple. I am sorry for wasting your time, Antes. :(

Let me say that I absolutely LOVE this Mod package. And many Hogvillians will, as well!
Doug Hazard
* Full Stack (Web) Developer for The Catholic Diocese of Richmond
(20+ Diocesan sites, 130+ Church sites & 24 School sites)
* Sports Photographer and Media Personality
* CFB Historian
* Tech Admin for one 1M+ post, one 2M+ post and one 10M+ post sites (last two are powered by multiple servers)
* WordPress Developer (Junkie / Guru / Maven / whatever)

Antes

Quote from: Douglas on July 31, 2015, 08:14:36 AM
* Douglas facepalms himself

Can't believe it was *that* simple. I am sorry for wasting your time, Antes. :(

Let me say that I absolutely LOVE this Mod package. And many Hogvillians will, as well!

nah np :P, I should rewrite the readme thingy.

Douglas

#28
Okay, legit bug report this time. :)

Quotehttp://www.hogville.net/yabbse/index.php?action=post;msg=9797708;topic=595789.50
8: Undefined index: twithash
Apply Filter: Only show the errors from this file
File: /XX/XX/XX/yabbse/Sources/BBCTwitter.php
Line: 89

Line 89 is noted below:
$buttons[count($buttons) - 1][] = array(
'image' => 'twithash',
'code' => 'hashtag',
'before' => '[hashtag]',
'after' => '[/hashtag]',
'description' => $txt['twithash']              // <----- LINE 89
);


It appears you're missing $txt['twithash'] from Modifications.english.php (and any other language file).

I added this to the file:
$txt['twithash'] = 'Twitter Hashtag';

Same issue for $txt['twitacc']

$buttons[count($buttons) - 1][] = array(
'image' => 'twitacc',
'code' => 'twitacc',
'before' => '[twitacc]',
'after' => '[/twitacc]',
'description' => $txt['twitacc']
);


Added this to Modifications.english.php:
$txt['twitacc'] = 'Twitter Account';

Same for this one...
$buttons[count($buttons) - 1][] = array(
'image' => 'twitmessage',
'code' => 'tweet',
'before' => '[tweet]',
'after' => '[/tweet]',
'description' => $txt['twitmessage']
);


Added $txt['twitmessage'] to Modifications.english.php

// Tweet Embed
$txt['invalid_tweet'] = 'Invalid Tweet ID';
$txt['twithash'] = 'Twitter Hashtag';
$txt['twitacc'] = 'Twitter Account';
$txt['twitmessage'] = 'Twitter Message';
Doug Hazard
* Full Stack (Web) Developer for The Catholic Diocese of Richmond
(20+ Diocesan sites, 130+ Church sites & 24 School sites)
* Sports Photographer and Media Personality
* CFB Historian
* Tech Admin for one 1M+ post, one 2M+ post and one 10M+ post sites (last two are powered by multiple servers)
* WordPress Developer (Junkie / Guru / Maven / whatever)

Antes

Are you sure you are using this modification :D :D this mod doesn't have BBCTwitter.php file.

* Antes confused bit...

Douglas

Hmph... weird. Guess I need to track down where I'm seeing that. Might be another mod that didn't get cleaned up properly upon removal
Doug Hazard
* Full Stack (Web) Developer for The Catholic Diocese of Richmond
(20+ Diocesan sites, 130+ Church sites & 24 School sites)
* Sports Photographer and Media Personality
* CFB Historian
* Tech Admin for one 1M+ post, one 2M+ post and one 10M+ post sites (last two are powered by multiple servers)
* WordPress Developer (Junkie / Guru / Maven / whatever)

JTVaughn

Quote from: Paracelsus on July 01, 2015, 07:41:29 PM
Some of our users have noticed that after autoembedding a tweet the smilies that come afterwards don't parse anymore as they supposed to. Even enclosing the tweet around another bbcode tag doesn't work because it doesn't recognize the closing tag after the autoembedded tweet.

I'm having this issue too, is there a fix?

Gluz

I have this installed in two forums + 2 test forums copy of the 2 main forums, and in one of my test forums it works well, no problems with smilies after the embed tweet, and the live version have same everything except one MOD in the test site, and that MOD added a fix for AutoLinkURLs conflict with their MOD, and surprisingly that fix this bug as well.

It seems that somehow after the positive validate/fetch tweet data, the smilies doesn't get parsed when the tweets are odd number, if you put a pair number of tweets the smilies get parsed well, and from there I can't follow the huge parse_bbc() function to understand what can be done there.

The MOD Hide Content have a fix in the last update that fixes this bug too, and after strip some code to test the exact code that do the trick I see that a dirty hack can be used but is not the best way to solve this:

This doesn't parse the smilies after an Embed Tweet
$message['body'] = parse_bbc($message['body'], $message['smileys_enabled'], $message['id_msg']);

This does
$message['body'] = parse_bbc($message['body'], $message['smileys_enabled'], $message['id_msg'], array('non_existent_BBC_tag'));
$message['body'] = parse_bbc($message['body'], $message['smileys_enabled'], $message['id_msg']);


Specifying a non existent BBC tag to the BBC parser it only parses the smilies and do it well, and the next will parse all the tags.

Maybe the team can find a way to modify the parse_bbc() function to save some cycles and fix the bug instead of that hack, because that hack need to be done in every call to parse_bbc() function, and as far as I see there are 15 places where need to put something similar to get it work in every place where a post can be showed.

stefan357965

Quote from: luuuciano on March 03, 2015, 11:53:13 AM
Very nice mod! simple and efective
Tried the other one, finally we are using yours

KUDOS



And the picture wins! :D

JTVaughn

Bump for help with above issues

TLMB

Thank you for this mod. :)

Count

It appears that the automatic twitter link parser breaks stuff if someone has linked with url bbcode. Something like [ url=https://www.twitter.com/whatever ] whatever [ /url ] shows the url with a hanging [/tweet] tag and looks really ugly. Tested on 2.0.11, when using 1.0 without the automatic parser everything works fine.

CreativeITWorld.com

Centering Tweets

Find
[tweet]$2[/tweet]

Replace with
[center][tweet]$2[/tweet][/center]

Dwev

I was happily using the mod in my forum, when today I noticed that it always embeds the parent tweet as well.

That's quite a problem when you want to include multiple tweets from a Twitter-thread, because you get every tweet double (once on it's own, and once in the next tweet as the parent tweet).

Is there maybe a way do disable the showing of the prent tweet?

pocttopus

This mod is not working properly.  :-[
Is there any way to configure this!?


luuuciano

Is that on firefox? maybe it is his tracking protection?
No me agradan los foros que no te dejan borrar TU PROPIO usuario, como por ejemplo smfsimple.com.
E incluso te mandan emails no solicitados, de los cuales, quizá, no puedas escapar porque NO te dejan posibilidad a deshabilitarlos (a menos que NO te tengan en su lista negra).

pocttopus

Yes, it's firefox.
It works on IE but I am not that mad to use it in the future.  :-[

luuuciano

Try Turn off Tracking Protection for individual sites
https://support.mozilla.org/en-US/kb/tracking-protection

If it works after disabling it...
No me agradan los foros que no te dejan borrar TU PROPIO usuario, como por ejemplo smfsimple.com.
E incluso te mandan emails no solicitados, de los cuales, quizá, no puedas escapar porque NO te dejan posibilidad a deshabilitarlos (a menos que NO te tengan en su lista negra).

pocttopus

Quote from: luuuciano on July 24, 2018, 08:55:32 AM
Try Turn off Tracking Protection for individual sites
https://support.mozilla.org/en-US/kb/tracking-protection

If it works after disabling it...
It works!
Thanks.  ;) :)

Yoksven

This mod isn't working in the way I was expecting. I thought it would embed tweet with BBcode, but instead it embeds tweets even without it. I often paste tweet links just as links using url tag or wrapped around an image, but with this mod installed it gets weird (illustration of the weird).

I wonder if there's any way to modify this mod to make it embed tweets only when BBcode [tweet][/tweet] is used and not do anything with tweet links otherwise?

Advertisement: