Simple Machines Community Forum

Customizing SMF => Modifications and Packages => Topic started by: vbgamer45 on January 11, 2015, 03:21:09 PM

Title: Auto Tweet Embed
Post by: vbgamer45 on January 11, 2015, 03:21:09 PM
Link to Mod (https://custom.simplemachines.org/mods/index.php?mod=3991)

This modification auto embeds twitter tweets in your forum. Caches the result since twitter has a limit of how many api calls per site that can be called at a time.

Developed by  L'arri
Packaged and modified by vbgamer45 https://www.smfhacks.com

Adds jquery to your forum hosted on cloudfare cdn

2.0
+Added support to Emoji's thanks to Arantor for changes needed

1.1
Changed end point

1.0.1
!Updated jquery library to use https


Licensed under: https://creativecommons.org/licenses/by-nd/4.0/ Attribution-NoDerivs
CC BY-ND
Title: Re: Auto Tweet Embed
Post by: nsno on January 12, 2015, 02:20:33 PM
excellent work!
Title: Re: Auto Tweet Embed
Post by: akbora on January 12, 2015, 04:57:27 PM
great and awesome works perfect...
Title: Re: Auto Tweet Embed
Post by: vbgamer45 on January 12, 2015, 05:20:47 PM
Glad you enjoy the mod!
Title: Re: Auto Tweet Embed
Post by: dimspace on January 29, 2015, 12:49:51 PM
Excellent, thanks again for developing, improving and packaging this.
Title: Re: Auto Tweet Embed
Post by: luuuciano on March 02, 2015, 06:14:05 AM
Nice mod, thanks!

BTW, it would be better to use something like this?


<script type="text/javascript">!window.jQuery && document.write(unescape('%3Cscript src="http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.1/jquery.min.js"%3E%3C/script%3E'))</script>

Title: Re: Auto Tweet Embed
Post by: Krissnikkers on May 31, 2015, 03:24:48 AM

Ok so I am thick....  How do you use this mod?

Tried the embed code that didn't work and then tired just the link and that didn't work either...  :(

Thanks in advance

Kriss :)
Title: Re: Auto Tweet Embed
Post by: Antes on May 31, 2015, 03:33:45 AM
You just need to paste the link of the tweet (like: https://twitter.com/CNNMoney/status/604905917272891392) - Modification does the rest for you.
Title: Re: Auto Tweet Embed
Post by: Krissnikkers on May 31, 2015, 03:37:15 AM

I tried that and all I got was the link and nothing else...  :(
Title: Re: Auto Tweet Embed
Post by: Antes on May 31, 2015, 03:52:36 AM
I installed the mod, it embeds but w/o styling. Seems like a problem from twitter side.
Title: Re: Auto Tweet Embed
Post by: Krissnikkers on May 31, 2015, 03:54:35 AM

Thank god...  means I am not stupid  ;D

Will see if the mod designer can do anything..  :)

Thanks for your help!

Kriss :)
Title: Re: Auto Tweet Embed
Post by: Antes on May 31, 2015, 04:14:12 AM
oh wait scratch the last post I made, mods working perfectly, do you have ghostery or alike blocker? If you block twitter embed js it won't show with style.
Title: Re: Auto Tweet Embed
Post by: Krissnikkers on May 31, 2015, 04:17:09 AM

As I have never heard of those I will presume no.. :D I have a like mod though

Kriss :)
Title: Re: Auto Tweet Embed
Post by: Kr1sp3r on June 18, 2015, 09:22:17 PM
I just installed this mod, but I am getting this error:-

Database Error
Incorrect string value: '\xF0\x9F\x94\x8A\xF0\x9F...' for column 'html' at row 1
File: /usr/home/chems/forum/www/tweet-cache.php
Line: 94

Any ideas?
Title: Re: Auto Tweet Embed
Post by: vbgamer45 on June 18, 2015, 10:33:14 PM
What kind of language set are you using?
Title: Re: Auto Tweet Embed
Post by: Kr1sp3r on June 18, 2015, 10:53:58 PM
The default is English ISO-8859-1.

I did notice when the mod installed that there was no /Themes/default/languages/Modifications.english-utf8.php file to modify, only /Themes/default/languages/Modifications.english.php.

I am just helping out with this site and don't know a lot about SMF, can you suggest a fix? Thanks.
Title: Re: Auto Tweet Embed
Post by: villasg on June 19, 2015, 03:24:51 AM
Hi .
In my 2.0.10 greek-utf8 do not work .
I have change ( add ) autotwitter.xml as follow

<file name="$languagedir/Modifications.greek-utf8.php">
<operation>
<search position="end" />
<add><![CDATA[
// Begin Auto Embed Twitter Strings
$txt['autotwitter_tweeterror'] = 'Tweet error (does not exist)';
$txt['autotwitter_blankid'] = 'Tweet error (blank ID)';
// END Auto Embed Twitter Strings
]]></add>
</operation>
</file>

Installed without errors .
But after test do not show tweets .
Need some configuration ?
Title: Re: Auto Tweet Embed
Post by: helyea on July 17, 2015, 07:56:19 AM
My tweet dont embed

(http://img.prntscr.com/img?url=http://i.imgur.com/qbZVTlq.png)
Title: Re: Auto Tweet Embed
Post by: JTVaughn on September 11, 2015, 07:22:45 AM
Tweets aren't embedding for me. Console shows this error:

Failed to load resource: the server responded with a status of 500 (Internal Server Error)

Any ideas?
Title: Re: Auto Tweet Embed
Post by: luuuciano on September 11, 2015, 08:35:40 AM
Quote from: JTVaughn on September 11, 2015, 07:22:45 AM
Tweets aren't embedding for me. Console shows this error:

Failed to load resource: the server responded with a status of 500 (Internal Server Error)

Any ideas?

Temporary twitter fault? it works here...

Oh, it looks like I was using this one finally http://custom.simplemachines.org/mods/index.php?mod=3837 ... not the one of this thread
Title: Re: Auto Tweet Embed
Post by: JTVaughn on September 11, 2015, 08:47:13 AM
Quote from: luuuciano on September 11, 2015, 08:35:40 AM
Quote from: JTVaughn on September 11, 2015, 07:22:45 AM
Tweets aren't embedding for me. Console shows this error:

Failed to load resource: the server responded with a status of 500 (Internal Server Error)

Any ideas?

Temporary twitter fault? it works here...

Oh, it looks like I was using this one finally http://custom.simplemachines.org/mods/index.php?mod=3837 ... not the one of this thread

I tried that one too and have problems with that one, I posted in that thread too :( Can't get either to work right
Title: Re: Auto Tweet Embed
Post by: luuuciano on September 11, 2015, 03:41:29 PM
Well... I have the emoticon issue too... I do not care for the moment :-D
Title: Re: Auto Tweet Embed
Post by: Stampie on November 25, 2015, 05:55:07 AM
can i use this inside blocks? i tried it but it can't... or is there any mods that can automatically shows my tweets to the forum?
Title: Re: Auto Tweet Embed
Post by: Gluz on November 25, 2015, 07:29:12 AM
Quote from: Stampie on November 25, 2015, 05:55:07 AM
can i use this inside blocks? i tried it but it can't... or is there any mods that can automatically shows my tweets to the forum?
If you want your account tweets in a portal block or similar, the easy way is make a widget in Twitter and use a block with custom HTML code in it.
Title: Re: Auto Tweet Embed
Post by: vbgamer45 on January 10, 2017, 08:10:05 PM
Update

1.0.1
!Updated jquery library to use https
Title: Re: Auto Tweet Embed
Post by: natcip on January 24, 2017, 09:57:29 AM
I got an error message when I ran the install.php. :-\
How do I manually install the content of install.php (it's not the first time my server had a problem running those files)
Title: Re: Auto Tweet Embed
Post by: Shambles on January 24, 2017, 10:02:31 AM
Quote from: natcip
I got an error message when I ran the install.php. :-\

And you can't say what that error message was?
Title: Re: Auto Tweet Embed
Post by: natcip on January 24, 2017, 10:26:01 AM
Quote from: Shambles on January 24, 2017, 10:02:31 AM
Quote from: natcip
I got an error message when I ran the install.php. :-\

And you can't say what that error message was?
It's interfering with another modification

Quote
Warning: Missing argument 2 for BBCode_Instagram_Embed(), called in /home/www/***/Sources/Subs.php on line 1734 and defined in /home/www/***/Sources/Subs-BBCode-Instagram.php on line 103

Warning: Missing argument 3 for BBCode_Instagram_Embed(), called in /home/www/***/Sources/Subs.php on line 1734 and defined in /home/www/***/Sources/Subs-BBCode-Instagram.php on line 103

Warning: Missing argument 4 for BBCode_Instagram_Embed(), called in /home/www/***/Sources/Subs.php on line 1734 and defined in /home/www/***/Sources/Subs-BBCode-Instagram.php on line 103

And this is what's in line 1734 in Subs.php:
BBCode_Instagram_Embed($message);

and line 103 in Subs-BBCode-Instagram.php:
function BBCode_Instagram_Embed(&$message, &$smileys, &$cache_id, &$parse_tags)
Title: Re: Auto Tweet Embed
Post by: Firehawk77 on April 25, 2017, 05:48:53 PM
I installed this today, didnt get any errors or anything.  I dont get any embeds though , the Tweet links are the only thing that still show on the forum


any ideas what could be wrong?
Title: Re: Auto Tweet Embed
Post by: vbgamer45 on April 25, 2017, 06:00:46 PM
What is an exact tweet link on your forum that is not embedding?
Title: Re: Auto Tweet Embed
Post by: Firehawk77 on April 26, 2017, 10:25:32 AM
Quote from: vbgamer45 on April 25, 2017, 06:00:46 PM
What is an exact tweet link on your forum that is not embedding?

I just copied and pasted a few tweet links...theres no BBC code to use, its just supposed to embed auto right?


http://www.illini-nation.net/forum/index.php?topic=27240.msg416495#msg416495
Title: Re: Auto Tweet Embed
Post by: vbgamer45 on April 26, 2017, 01:45:13 PM
I see the issue
Fix the file permissions on http://www.illini-nation.net/forum/tweet-cache.php
Make it 755 or 644


I tested and it embeds on my forum.
Title: Re: Auto Tweet Embed
Post by: Firehawk77 on April 26, 2017, 03:12:30 PM
Quote from: vbgamer45 on April 26, 2017, 01:45:13 PM
I see the issue
Fix the file permissions on http://www.illini-nation.net/forum/tweet-cache.php
Make it 755 or 644


I tested and it embeds on my forum.

changed to 644, that did it! thanks!
Title: Re: Auto Tweet Embed
Post by: vbgamer45 on April 26, 2017, 03:26:48 PM
Glad to help. I went U of I Champaign as well.
Title: Re: Auto Tweet Embed
Post by: pocttopus on May 10, 2017, 04:38:57 AM
Hello,

The twitter mod is not working properly. There is no error and I cannot figure it out what could be the issue. Any advice please?
Here is an example: http://forum.mkreef.com/index.php?topic=10824.msg173258#msg173258

Thanks!
Title: Re: Auto Tweet Embed
Post by: vbgamer45 on May 10, 2017, 07:25:02 AM
You have the same error has previous poster
http://forum.mkreef.com/tweet-cache.php
Fix the file permissions
Make it 755 or 644
Title: Re: Auto Tweet Embed
Post by: pocttopus on May 10, 2017, 07:49:02 AM
The permissions are already 755 and it won't work with 644 either.  :(
Title: Re: Auto Tweet Embed
Post by: vbgamer45 on May 10, 2017, 08:06:02 AM
Try 777 and make sure it is owned by the correct user
Make sure the file exists at http://forum.mkreef.com/tweet-cache.php
You shouldn't get a 403 error when you visit the page.
Title: Re: Auto Tweet Embed
Post by: pocttopus on May 10, 2017, 08:15:29 AM
If I use 777 the whole forum won't work. I got error 403.
And also tweet-cache.php file is in the root of the forum
Title: Re: Auto Tweet Embed
Post by: vbgamer45 on May 10, 2017, 08:18:35 AM
Something isn't right then with file permissions or file ownership of that file I would compare to the other files that are there or check your servers error log for more informatoin
Title: Re: Auto Tweet Embed
Post by: pocttopus on May 10, 2017, 08:27:05 AM
Quote from: vbgamer45 on May 10, 2017, 08:18:35 AM
Something isn't right then with file permissions or file ownership of that file I would compare to the other files that are there or check your servers error log for more informatoin
I don't have a clue how to solve these issues what you have mention.
Please for advise?  :(
Title: Re: Auto Tweet Embed
Post by: vbgamer45 on May 10, 2017, 08:28:21 AM
I would try to get your hosting provider to look into then they may have an idea.
Title: Re: Auto Tweet Embed
Post by: pocttopus on May 10, 2017, 04:16:51 PM
SOLVED!
Issue was on file without 755 permission.

Thanks!
Title: Re: Auto Tweet Embed
Post by: vbgamer45 on May 10, 2017, 04:28:33 PM
Glad you have it working!
Title: Re: Auto Tweet Embed
Post by: Xpresskonami on May 12, 2017, 07:49:20 AM
This mod stop embedding. please how can I fix the error.
Title: Re: Auto Tweet Embed
Post by: vbgamer45 on May 12, 2017, 08:29:57 AM
Link to forum that has the twitter post
Title: Re: Auto Tweet Embed
Post by: Xpresskonami on May 12, 2017, 08:37:05 AM
Quote from: vbgamer45 on May 12, 2017, 08:29:57 AM
Link to forum that has the twitter post

This is the link

http://spyloadedtv.com/politics-news/buhari-treats-me-like-his-son-osinbajo-says/
Title: Re: Auto Tweet Embed
Post by: vbgamer45 on May 12, 2017, 08:40:32 AM
Your site isn't loading mostly for me I get a whitebackground and I did see this n the error log in firebug

ReferenceError: sp_image_resize is not defined[Learn More]  buhari-treats-me-like-his-son-osinbajo-says:217:3
ReferenceError: smc_Toggle is not defined[Learn More]  buhari-treats-me-like-his-son-osinbajo-says:327:8
jquery is already loaded with version: 2.1.1  buhari-treats-me-like-his-son-osinbajo-says:986:5
result of version check: 1  buhari-treats-me-like-his-son-osinbajo-says:988:6
ReferenceError: QuickReply is not defined[Learn More]  buhari-treats-me-like-his-son-osinbajo-says:851:10
TypeError: urlMatched is null[Learn More]
Title: Re: Auto Tweet Embed
Post by: Xpresskonami on May 12, 2017, 10:19:46 AM
Quote from: vbgamer45 on May 12, 2017, 08:40:32 AM
Your site isn't loading mostly for me I get a whitebackground and I did see this n the error log in firebug

ReferenceError: sp_image_resize is not defined[Learn More]  buhari-treats-me-like-his-son-osinbajo-says:217:3
ReferenceError: smc_Toggle is not defined[Learn More]  buhari-treats-me-like-his-son-osinbajo-says:327:8
jquery is already loaded with version: 2.1.1  buhari-treats-me-like-his-son-osinbajo-says:986:5
result of version check: 1  buhari-treats-me-like-his-son-osinbajo-says:988:6
ReferenceError: QuickReply is not defined[Learn More]  buhari-treats-me-like-his-son-osinbajo-says:851:10
TypeError: urlMatched is null[Learn More]

but its loading on my firefox browser here
Title: Re: Auto Tweet Embed
Post by: Xpresskonami on May 12, 2017, 10:52:53 AM
as it open ???
Title: Re: Auto Tweet Embed
Post by: vbgamer45 on May 12, 2017, 11:09:25 AM
I see javascript errors like this. That would prevent it from working. From other mods or sites code

Error: Invalid argument  sdk.js:62:151
jquery is already loaded with version: 2.1.1  buhari-treats-me-like-his-son-osinbajo-says:986:5
result of version check: 1  buhari-treats-me-like-his-son-osinbajo-says:988:6
TypeError: urlMatched is null[Learn More]
Title: Re: Auto Tweet Embed
Post by: Xpresskonami on May 12, 2017, 11:43:40 AM
Quote from: vbgamer45 on May 12, 2017, 11:09:25 AM
I see javascript errors like this. That would prevent it from working. From other mods or sites code

Error: Invalid argument  sdk.js:62:151
jquery is already loaded with version: 2.1.1  buhari-treats-me-like-his-son-osinbajo-says:986:5
result of version check: 1  buhari-treats-me-like-his-son-osinbajo-says:988:6
TypeError: urlMatched is null[Learn More]

i dont know where the error comes from, immediately i install facebook embed mod i discover that the facebook mod didnt work for me, same also as the instagram mod too, so i unistalled them, that is what i think may cause the tweet mod stop working , because it works before. i really want to fix the tweet mod error please.
Title: Re: Auto Tweet Embed
Post by: vbgamer45 on May 12, 2017, 12:04:06 PM
Yeah I would ask someone for help. The error is not from this mod but from another script you have.
Title: Re: Auto Tweet Embed
Post by: Xpresskonami on May 12, 2017, 12:18:28 PM
Quote from: vbgamer45 on May 12, 2017, 12:04:06 PM
Yeah I would ask someone for help. The error is not from this mod but from another script you have.

ok will be expecting you
Title: Re: Auto Tweet Embed
Post by: vbgamer45 on May 12, 2017, 12:34:54 PM
Sorry i don't have time I would ask on the help wanted forum.
Title: Re: Auto Tweet Embed
Post by: pocttopus on May 13, 2017, 09:43:52 AM
Quote from: Xpresskonami on May 12, 2017, 08:37:05 AM
Quote from: vbgamer45 on May 12, 2017, 08:29:57 AM
Link to forum that has the twitter post

This is the link

http://spyloadedtv.com/politics-news/buhari-treats-me-like-his-son-osinbajo-says/
Quote from: Xpresskonami on May 12, 2017, 12:18:28 PM
Quote from: vbgamer45 on May 12, 2017, 12:04:06 PM
Yeah I would ask someone for help. The error is not from this mod but from another script you have.

ok will be expecting you
Your forum is in a big mess and is not working properly. You need to clean the forum-software from all scripts you had installed or try with clean installation. And another advice, don't expect developers of modification's to clean up your forum.  ???
You must do it by yourself.   O:)

Title: Re: Auto Tweet Embed
Post by: Steve on May 13, 2017, 02:10:15 PM
Quote from: pocttopus on May 13, 2017, 09:43:52 AMYour forum is in a big mess and is not working properly. You need to clean the forum-software from all scripts you had installed or try with clean installation.

Not sure where you're getting this as it works just fine for me.

@ Xpresskonami - pick and choose the advice you accept wisely
Title: Re: Auto Tweet Embed
Post by: Xpresskonami on May 13, 2017, 06:16:39 PM

Quote
Your forum is in a big mess and is not working properly. You need to clean the forum-software from all scripts you had installed or try with clean installation. And another advice, don't expect developers of modification's to clean up your forum.  ???
You must do it by yourself.   O:)

How will i clean my forum? i have notification on upgrading my database too. have been searching the forum here on how to go about it, but havent seen any.
Title: Re: Auto Tweet Embed
Post by: Steve on May 13, 2017, 07:37:47 PM
He's talking about uploading a fresh set of files: http://wiki.simplemachines.org/smf/How_to_upload_a_fresh_set_of_files

However:

Quote from: Steve on May 13, 2017, 02:10:15 PM@ Xpresskonami - pick and choose the advice you accept wisely
Title: Re: Auto Tweet Embed
Post by: Xpresskonami on May 13, 2017, 08:05:06 PM
Quote from: Steve on May 13, 2017, 07:37:47 PM
He's talking about uploading a fresh set of files: http://wiki.simplemachines.org/smf/How_to_upload_a_fresh_set_of_files

However:

Quote from: Steve on May 13, 2017, 02:10:15 PM@ Xpresskonami - pick and choose the advice you accept wisely

ok thanks
Title: Re: Auto Tweet Embed
Post by: pocttopus on May 27, 2017, 06:56:01 AM
Hello,

I don't know why but some tweet's are embedded but some are not.  :-\
Is there any explanation or advice how to solve this?  ???

Thanks!
Title: Re: Auto Tweet Embed
Post by: vbgamer45 on May 27, 2017, 08:17:04 AM
I would have to see examples.
Title: Re: Auto Tweet Embed
Post by: pocttopus on May 27, 2017, 08:23:00 AM
Here is the example:
Tweet that is not embedded properly: http://forum.mkreef.com/index.php?topic=10977.msg173534#msg173534
Tweet that is embedded: http://forum.mkreef.com/index.php?topic=10824.msg173502#msg173502

Thanks!
Title: Re: Auto Tweet Embed
Post by: pocttopus on June 03, 2017, 04:58:15 AM
Still no response?  :o
Title: Re: Auto Tweet Embed
Post by: vbgamer45 on June 03, 2017, 08:09:29 AM
I am not sure what is going on with that one. It returns this html

<blockquote class="twitter-tweet"><p lang="bg" dir="ltr"><a href="https://twitter.com/hashtag/%D0%94%D0%BE%D0%B1%D1%80%D0%BE%D0%A3%D1%82%D1%80%D0%BE?src=hash">#ДоброУтро</a> <a href="https://twitter.com/hashtag/%D0%BE%D0%BD%D0%B0%D0%BA%D0%BE%D0%B3%D0%B0?src=hash">#онакога</a> имаме славеник на форум и сите заедно му посакуваме <a href="https://twitter.com/hashtag/%D0%A1%D1%80%D0%B5%D1%9C%D0%B5%D0%BD%D0%A0%D0%BE%D0%B4%D0%B5%D0%BD%D0%B4%D0%B5%D0%BD?src=hash">#СреќенРоденден</a> на <a href="https://twitter.com/velkovski_ivica">@velkovski_ivica</a> и многу многу <a href="https://twitter.com/hashtag/%D0%B0%D0%BA%D0%B2%D0%B0%D1%80%D0%B8%D1%83%D0%BC?src=hash">#аквариум</a>-и.
Title: Re: Auto Tweet Embed
Post by: pocttopus on June 03, 2017, 08:21:29 AM
I'm not sure either but this is another similar situation.
Here is another example of how some tweets are embedded and some are not. Just scroll to the bottom. :(
http://forum.mkreef.com/index.php?topic=10824.msg173577#msg173577
Title: Re: Auto Tweet Embed
Post by: pocttopus on June 09, 2017, 03:23:07 AM
No advice?  ??? :-\
Title: Re: Auto Tweet Embed
Post by: vbgamer45 on June 09, 2017, 08:04:14 AM
Not at this time not sure what else to do.
Title: Re: Auto Tweet Embed
Post by: pocttopus on June 12, 2017, 01:31:15 PM
Quote from: vbgamer45 on June 09, 2017, 08:04:14 AM
Not at this time not sure what else to do.
Okay... thanks!
I'll wait for an update version.
Title: Re: Auto Tweet Embed
Post by: pocttopus on August 11, 2017, 05:58:07 AM
Still no updates about the issue why some tweets are not embedded? ??? :-[
Title: Re: Auto Tweet Embed
Post by: vbgamer45 on August 11, 2017, 08:15:09 AM
None
Title: Re: Auto Tweet Embed
Post by: pocttopus on September 10, 2017, 10:25:25 AM
Why this mod is not working at all? The tweets are not embeded. :-[
http://f1legacy.com/index.php?topic=3.0
Title: Re: Auto Tweet Embed
Post by: vbgamer45 on September 10, 2017, 11:14:15 AM
File permission issue page not displayed
http://f1legacy.com/tweet-cache.php?id=903567377220210688
Title: Re: Auto Tweet Embed
Post by: pocttopus on September 10, 2017, 11:38:22 AM
Thanks for your response but I don't know where to look for those file permissions.  :-[
Where is it?  ???

*edit - The permission on tweet-cache file is 666.
Title: Re: Auto Tweet Embed
Post by: vbgamer45 on September 10, 2017, 11:48:14 AM
Try 777 or check file owner.
Title: Re: Auto Tweet Embed
Post by: pocttopus on September 10, 2017, 11:56:41 AM
Can you give me tips how to find file owner?
I changed directly via filezilla on ftp to 777 but no change.
Title: Re: Auto Tweet Embed
Post by: vbgamer45 on September 10, 2017, 11:57:21 AM
I would contact your host or search on google.
Title: Re: Auto Tweet Embed
Post by: pocttopus on September 10, 2017, 12:02:27 PM
I tried with 755 and it worked.
I don't know why 777 does not going properly.
Thanks vbgamer45!  :)
Title: Re: Auto Tweet Embed
Post by: confuseamuse on November 07, 2017, 10:40:26 AM
How would I remove the twitter link from automatically being added below the tweet?
Title: Re: Auto Tweet Embed
Post by: vbgamer45 on November 07, 2017, 10:41:31 AM
You may have to modify the mods code if there is no setting for it.
Title: Re: Auto Tweet Embed
Post by: Rob Lightbody on April 07, 2018, 05:33:59 AM
Working well "out of the box" on 2.0.15.  Thanks.
Title: Re: Auto Tweet Embed
Post by: vbgamer45 on April 07, 2018, 09:25:56 AM
Glad you enjoy it.
Title: Re: Auto Tweet Embed
Post by: pocttopus on April 08, 2018, 03:47:36 PM
I still dont have a clue why tweets are not displayed!?  :o :-[
https://f1legacy.com/races-21/bahrain-gp-sunday-summary-vettel-2nd-win-of-the-season/msg198/#msg198
Title: Re: Auto Tweet Embed
Post by: Rich N-O on April 11, 2018, 07:40:18 AM
Got a couple of change requests if possible.

1. Auto-embed mobile.twitter.com links.
2. Auto-hide query strings.

TIA
Title: Re: Auto Tweet Embed
Post by: UFT on May 15, 2018, 05:30:23 PM
He VB.  I can't get this mod to work.  I am using this theme --> Startaza (https://www.simplemachines.org/community/index.php?topic=557598.0)

Any idea why it wouldn't work?

Thanks for the help!!
Title: Re: Auto Tweet Embed
Post by: vbgamer45 on May 15, 2018, 08:05:06 PM
Doesn't install or does not work?
Title: Re: Auto Tweet Embed
Post by: UFT on May 15, 2018, 08:37:42 PM
It installs correctly but it just doesn't do anything
Title: Re: Auto Tweet Embed
Post by: vbgamer45 on May 15, 2018, 08:43:28 PM
Link to a post with twitter link that it is not doing anything.
Title: Re: Auto Tweet Embed
Post by: UFT on May 15, 2018, 09:14:05 PM
Here you go VB:  https://ultrafusedthemes.com/smf/index.php?topic=4.0
Title: Re: Auto Tweet Embed
Post by: UFT on May 15, 2018, 09:20:28 PM
Could it be because my test environment is https?
Title: Re: Auto Tweet Embed
Post by: vbgamer45 on May 15, 2018, 10:17:04 PM
You have a file permission error on
https://ultrafusedthemes.com/smf/tweet-cache.php?id=996227930161401857

Check file permissions for that file
Title: Re: Auto Tweet Embed
Post by: UFT on May 15, 2018, 10:24:43 PM
Quote from: vbgamer45 on May 15, 2018, 10:17:04 PM
You have a file permission error on
https://ultrafusedthemes.com/smf/tweet-cache.php?id=996227930161401857

Check file permissions for that file

I tried 755 and 777 and it still didn't work
Title: Re: Auto Tweet Embed
Post by: vbgamer45 on May 15, 2018, 10:43:38 PM
If not check your apache server error log with hostgator
Title: Re: Auto Tweet Embed
Post by: UFT on May 16, 2018, 08:32:51 AM
Quote from: vbgamer45 on May 15, 2018, 10:43:38 PM
If not check your apache server error log with hostgator

Not really sure where to check that.  Any advice?
Title: Re: Auto Tweet Embed
Post by: UFT on May 16, 2018, 08:44:02 AM
I found it - attached.
Title: Re: Auto Tweet Embed
Post by: vbgamer45 on May 16, 2018, 08:58:16 AM
None of those errors seems to be related to that file.

Try permissions of 644 on the file.
Title: Re: Auto Tweet Embed
Post by: UFT on May 16, 2018, 12:19:14 PM
Unfortunately it didn't help.
Title: Re: Auto Tweet Embed
Post by: UFT on May 16, 2018, 12:25:57 PM
I set the tweet-cache.php to 644 and the whole folder is 755
Title: Re: Auto Tweet Embed
Post by: vbgamer45 on May 16, 2018, 12:33:57 PM
Out of ideas. I have only see that happen due to file ownership issues.
Title: Re: Auto Tweet Embed
Post by: UFT on May 16, 2018, 12:37:50 PM
Quote from: vbgamer45 on May 16, 2018, 12:33:57 PM
Out of ideas. I have only see that happen due to file ownership issues.

Thanks anyway.  Sorry we can't use it.
Title: Re: Auto Tweet Embed
Post by: UFT on May 16, 2018, 12:53:38 PM
The attached error log is from the current live site that is using this mod.  Any ideas?
Title: Re: Auto Tweet Embed
Post by: vbgamer45 on May 16, 2018, 01:52:00 PM
Thanks that may help
Title: Re: Auto Tweet Embed
Post by: UFT on May 16, 2018, 05:07:38 PM
So I deleted everything on my test site - DB and all.  I did a new/clean install.  The only package I have is Auto Tweet Embed and Responsive Curve.  The tweet-cache.php file permission set to 644.  Tested on SMF Default Theme - Curve, Core Theme, and Startaza themes.  No errors in SMF or server error_log - it still doesn't work.

No other ideas?
Title: Re: Auto Tweet Embed
Post by: vbgamer45 on May 17, 2018, 09:31:48 AM
Try some other twitter urls I want to see if it is just that one or all of them.
Title: Re: Auto Tweet Embed
Post by: UFT on May 17, 2018, 12:41:58 PM
https://ultrafusedthemes.com/index.php?topic=3.0
Title: Re: Auto Tweet Embed
Post by: luuuciano on May 17, 2018, 02:56:32 PM
We have used this in the past http://custom.simplemachines.org/mods/index.php?mod=3837
Suki released a new one too?
Title: Re: Auto Tweet Embed
Post by: UFT on May 17, 2018, 07:30:05 PM
Thanks but I'm probably going to go with NIBOGO's Auto Media Embedder. 
Title: Re: Auto Tweet Embed
Post by: UFT on May 18, 2018, 11:37:16 PM
Quote from: UFT on May 17, 2018, 07:30:05 PM
Thanks but I'm probably going to go with NIBOGO's Auto Media Embedder.

I got NIBOGO's Media Embedder - it works perfectly!
Title: Re: Auto Tweet Embed
Post by: Rob Lightbody on December 04, 2018, 01:54:27 PM
Hello!

This has been working fine for me for months, but now is erroring as follows :-

id=1063476798875418626
Database Error: Incorrect string value: '\xF0\x9F\x9A\xA2\xF0\x9F...' for column 'html' at row 1
File: /home/theqesto/public_html/forum/tweet-cache.php
Line: 94

Any ideas?

Thanks,

- Rob
Title: Re: Auto Tweet Embed
Post by: Arantor on December 04, 2018, 03:08:20 PM
Emojis don't seem to be supported.
Title: Re: Auto Tweet Embed
Post by: vbgamer45 on February 13, 2019, 10:01:19 PM
+Added install support for SMF 2.1 RC1
Title: Re: Auto Tweet Embed
Post by: natcip on February 21, 2019, 12:48:59 PM
This is a lovely mod. Thank you! :)

Some users on my forum noted that tweets with parameters at the end of the URL can't be processed and it just shows the link.

For example
https://twitter.com/skyferreira/status/1098510248443142144?s=21
Title: Re: Auto Tweet Embed
Post by: vbgamer45 on February 21, 2019, 01:17:56 PM
Will check it out.
Title: Re: Auto Tweet Embed
Post by: natcip on May 10, 2019, 01:06:57 PM
Quote from: vbgamer45 on February 21, 2019, 01:17:56 PM
Will check it out.
Thank you! Has this been fixed in the last version? :)
Title: Re: Auto Tweet Embed
Post by: vbgamer45 on May 10, 2019, 01:45:23 PM
haven't had time to look
Title: Re: Auto Tweet Embed
Post by: ozbob on July 29, 2019, 08:23:18 PM
Heads up.  Auto Twitter Embed 1.0.1 to embed tweets in posts on my forum.  Suddenly stated to have ' long running script ' issues, threads would hang etc.  Uninstalled mod and problem went away.  I suspect something has changed at twitter end to cause the issue.

Bob
Title: Re: Auto Tweet Embed
Post by: MPHV on August 23, 2019, 03:36:12 PM
I'm also having problems with the MOD on my site.

Tweets are no longer shown, it only shows a frame with the text:
Tweet error (does not exist)

If you click the link of the tweet, the tweet ofcourse does exist....

For example:
https://www.hulpverleningsforum.nl/index.php/topic,106215.msg1504797.html#msg1504797

Any suggestions?


Title: Re: Auto Tweet Embed
Post by: MPHV on August 25, 2019, 05:35:49 AM
I've been debugging a bit myself,

seems it goes wrong in fetching the json from the API,
this returns an error: TCP connection reset by peer

The URL is valid, when i enter it in the browser, i get the json file back.
Title: Re: Auto Tweet Embed
Post by: MPHV on August 25, 2019, 07:57:06 AM
Well i guess i found it....

I ran a test using this code:
Quote<?php
$tweet = 1163869660086861825;
$twitterapi_url = "https://api.twitter.com/1/statuses/oembed.json?id=";
$twitterapi_url = $twitterapi_url . $tweet;

if (function_exists('curl_init')) {
    $curl = curl_init($twitterapi_url);
    curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($curl,CURLOPT_SSL_VERIFYPEER, FALSE);
    $response = curl_exec($curl);
    var_dump($response);
    curl_close($curl);
}
   ?>

Running it on our production server results in bool(false).
Any other server running the same code results in correct output

Ergo: Did twitter block our server?
Title: Re: Auto Tweet Embed
Post by: vbgamer45 on August 25, 2019, 12:34:50 PM
Try this version and see if it helps
Title: Re: Auto Tweet Embed
Post by: MPHV on August 25, 2019, 03:01:41 PM
Thanks, however unfortunately it gives the same results, would it be a possibility twitter blacklisted my server from the API? 
A test i performed from another server (with the old code) was sucessfull.
Title: Re: Auto Tweet Embed
Post by: vbgamer45 on August 25, 2019, 03:03:19 PM
Yes it could be then do have limits.
I tested your twitter link on my test forum and it worked ok.

Try a different twitter link the old one might be cached though.
Title: Re: Auto Tweet Embed
Post by: MPHV on September 01, 2019, 01:47:35 PM
Hi,

Update from my side.
I have rebuild the plugin, using this PHP wrapper for twitter: https://github.com/J7mbo/twitter-api-php
and the API function: https://publish.twitter.com/oembed.json

I did have to register as a developer with Twitter in order to get API keys, which are required.

Let me know if your interested in my code, happy to share.
Title: Re: Auto Tweet Embed
Post by: vbgamer45 on September 01, 2019, 02:03:01 PM
Sure I would like to see it.
Title: Re: Auto Tweet Embed
Post by: imtml on October 06, 2019, 06:00:13 AM
Hello everyone.

I have this mod with 1.1.1 and SMF with the latest 2.0.15 but when I post a link, it seems as "Invalid Tweet ID" no matter what tweet I post. It was working fine since last month. And the funny thing, when I remove the package, I still see the same error.

How can fix it?
Title: Re: Auto Tweet Embed
Post by: imtml on October 07, 2019, 06:17:19 AM
Quote from: imtml on October 06, 2019, 06:00:13 AM
Hello everyone.

I have this mod with 1.1.1 and SMF with the latest 2.0.15 but when I post a link, it seems as "Invalid Tweet ID" no matter what tweet I post. It was working fine since last month. And the funny thing, when I remove the package, I still see the same error.

How can fix it?


I really need help on this. Does anybody know anything?
Title: Re: Auto Tweet Embed
Post by: imtml on October 30, 2019, 01:16:04 PM
Quote from: imtml on October 06, 2019, 06:00:13 AM
Hello everyone.

I have this mod with 1.1.1 and SMF with the latest 2.0.15 but when I post a link, it seems as "Invalid Tweet ID" no matter what tweet I post. It was working fine since last month. And the funny thing, when I remove the package, I still see the same error.

How can fix it?


Please. Please.

It's the same problem for at least 2 months.I uninstalled the mod, nothing changes. I'm going to go crazy.
Title: Re: Auto Tweet Embed
Post by: vbgamer45 on October 30, 2019, 01:26:54 PM
Upload the package to https://www.smfhacks.com/smf-package-parser.html

Then check that all the edits have been reversed.
Title: Re: Auto Tweet Embed
Post by: imtml on October 30, 2019, 01:49:05 PM
Quote from: vbgamer45 on October 30, 2019, 01:26:54 PM
Upload the package to https://www.smfhacks.com/smf-package-parser.html

Then check that all the edits have been reversed.

I did. And then what? There's no useful info I got there.
Title: Re: Auto Tweet Embed
Post by: vbgamer45 on October 30, 2019, 01:49:50 PM
It tells you what files were edited by the modification. Just make sure all the modification code is removed.
Title: Re: Auto Tweet Embed
Post by: imtml on October 30, 2019, 02:03:07 PM
Quote from: vbgamer45 on October 30, 2019, 01:49:50 PM
It tells you what files were edited by the modification. Just make sure all the modification code is removed.

I can't really understand it. Can you please tell me what to do?

(https://i.ibb.co/2YvQX1g/Screenshot-1.jpg) (https://ibb.co/Tq4Szxm)
Title: Re: Auto Tweet Embed
Post by: vbgamer45 on October 30, 2019, 02:13:05 PM
See the edit it makes load.php and make sure that edit does not exist.
Title: Re: Auto Tweet Embed
Post by: imtml on October 30, 2019, 02:40:20 PM
Quote from: vbgamer45 on October 30, 2019, 02:13:05 PM
See the edit it makes load.php and make sure that edit does not exist.
*
Forgive me but I don't think I understood. Can u please be clearer
Title: Re: Auto Tweet Embed
Post by: vbgamer45 on October 30, 2019, 02:46:49 PM
Edit Sources/Loads.php and remove the code added by this mod.
Title: Re: Auto Tweet Embed
Post by: imtml on October 30, 2019, 02:56:15 PM
Quote from: vbgamer45 on October 30, 2019, 02:46:49 PM
Edit Sources/Loads.php and remove the code added by this mod.

I'm really not good at this. Which line/codes do I have to remove?
Title: Re: Auto Tweet Embed
Post by: imtml on October 30, 2019, 03:01:32 PM
Can you please edit it and send me back? I know I want so much. But, please.

https://files.fm/f/vkygkdsp
Title: Re: Auto Tweet Embed
Post by: vbgamer45 on October 30, 2019, 03:03:39 PM
yes, please attach to this post
Title: Re: Auto Tweet Embed
Post by: imtml on October 30, 2019, 03:35:20 PM
Quote from: vbgamer45 on October 30, 2019, 03:03:39 PM
yes, please attach to this post

Here you go. Thank you.
Title: Re: Auto Tweet Embed
Post by: vbgamer45 on October 30, 2019, 03:55:59 PM
Updated file attached
Title: Re: Auto Tweet Embed
Post by: imtml on October 30, 2019, 04:00:01 PM
Quote from: vbgamer45 on October 30, 2019, 03:55:59 PM
Updated file attached


Thank you but it's still same. When I post a Twitter link, it seems as "Invalid Tweet ID."

http://www.lakerstr.com/forum/index.php?topic=54.msg255#msg255
Title: Re: Auto Tweet Embed
Post by: vbgamer45 on October 30, 2019, 04:02:55 PM
Try new posts with twitter link.
Might be an issue with old posts.
Title: Re: Auto Tweet Embed
Post by: imtml on October 30, 2019, 04:07:23 PM
Quote from: vbgamer45 on October 30, 2019, 04:02:55 PM
Try new posts with twitter link.
Might be an issue with old posts.

Nope. It's still same.

Funny fact, even though I uninstall/remove the package, I still get the same error. I can't see the normal Twitter link even if I don't want to use this mod.

This is frustrating.
Title: Re: Auto Tweet Embed
Post by: vbgamer45 on October 30, 2019, 04:09:30 PM
It might not be this mod in this case....
Title: Re: Auto Tweet Embed
Post by: imtml on October 30, 2019, 04:13:31 PM
Quote from: vbgamer45 on October 30, 2019, 04:09:30 PM
It might not be this mod in this case....

I downloaded and uploaded from here. https://custom.simplemachines.org/mods/index.php?mod=3991

It's this mod.
Title: Re: Auto Tweet Embed
Post by: vbgamer45 on October 30, 2019, 04:17:51 PM
That edit in load.php is the only one the mod makes....if it happens on new posts then it is not the fault of the mod.
Title: Re: Auto Tweet Embed
Post by: imtml on October 30, 2019, 04:23:20 PM
Quote from: vbgamer45 on October 30, 2019, 04:17:51 PM
That edit in load.php is the only one the mod makes....if it happens on new posts then it is not the fault of the mod.

I see but, do you have any idea how can I fix this whole mess? I can't even use it without the mod.
Title: Re: Auto Tweet Embed
Post by: imtml on October 30, 2019, 04:32:02 PM
This mod broke something on the forum and whatever I do now, it doesn't ever work.
Title: Re: Auto Tweet Embed
Post by: vbgamer45 on October 30, 2019, 04:43:32 PM
Not sure, at this point either. If mod is removed it shouldn't cause any new issues.
Title: Re: Auto Tweet Embed
Post by: imtml on October 31, 2019, 06:28:21 AM
Quote from: vbgamer45 on October 30, 2019, 04:43:32 PM
Not sure, at this point either. If mod is removed it shouldn't cause any new issues.

https://www.simplemachines.org/community/index.php?topic=570349.msg4036250#msg4036250
Title: Re: Auto Tweet Embed
Post by: imtml on November 01, 2019, 07:34:15 AM
Hello vbgamer45,

Now I have a different problem. I upgraded my SMF to a virgin state. I don't get "Invalid Tweed ID" error anymore.

But now, it seems like this. Every Tweet seems like this.

Tweet error (does not exist)

(https://i.ibb.co/72mh3gJ/ss-2.jpg)
Title: Re: Auto Tweet Embed
Post by: imtml on November 01, 2019, 12:43:37 PM
Ladies and gentleman,

This mod either breaks your forum or doesn't work properly. And the author claims that "he has nothing to do".

Sincerely.

Have a wonderful weekend.
Title: Re: Auto Tweet Embed
Post by: Arantor on November 01, 2019, 12:45:25 PM
Except that it works for other users and when you uninstalled it, you had other bugs relating to Twitter that do not happen in an unmodified SMF so very likely it isn't actually this mod.
Title: Re: Auto Tweet Embed
Post by: imtml on November 01, 2019, 12:49:19 PM
Quote from: Arantor on November 01, 2019, 12:45:25 PM
Except that it works for other users and when you uninstalled it, you had other bugs relating to Twitter that do not happen in an unmodified SMF so very likely it isn't actually this mod.
Yes, maybe. So I posted my latest problem and if no one has nothing to do with that, there's something wrong with something, right? And I'm not the expert to be able to solve it.
Title: Re: Auto Tweet Embed
Post by: vbgamer45 on November 01, 2019, 01:29:14 PM
Sources/Load.php was the only edit it makes and there are no hooks. I gave you the edited file with that code removed. If you have a new set of files from SMF then there is no way the mod could be installed unless you installed the mod again...
Title: Re: Auto Tweet Embed
Post by: imtml on November 01, 2019, 03:29:32 PM
Quote from: vbgamer45 on November 01, 2019, 01:29:14 PM
Sources/Load.php was the only edit it makes and there are no hooks. I gave you the edited file with that code removed. If you have a new set of files from SMF then there is no way the mod could be installed unless you installed the mod again...
Aight thanks.
Title: Re: Auto Tweet Embed
Post by: Xpresskonami on December 15, 2019, 10:21:52 PM
Quote from: Xpresskonami on May 12, 2017, 07:49:20 AM
This mod stop embedding. please how can I fix the error.

I raise comment on this mod previous year about this mod stop working on my forum. i have do lot of changes on my forum. and the mod is not working on my forum yet, please check out the tweet link page in my forum https://bit.ly/2S1WoAp
Title: Re: Auto Tweet Embed
Post by: Xpresskonami on December 16, 2019, 03:07:54 PM
I just hope anyone could assist me on this
Title: Re: Auto Tweet Embed
Post by: Rob Lightbody on December 22, 2019, 07:02:11 AM
I still use this mod, with SMF 2.0.15, and it works fine.

The only thing that catches it out, is anything after the ? in the tweet.  If I copy a tweet , it adds ?s=19 to the end - and this "breaks" the mod.  I know to remove it, but my users don't.

Thanks.
Title: Re: Auto Tweet Embed
Post by: vbgamer45 on December 22, 2019, 08:53:08 AM
Hmm, I would need to add support for the mod for the ?s= query string.
Title: Re: Auto Tweet Embed
Post by: Hamm9 on January 21, 2020, 09:25:27 PM
I have installed Auto Tweet Embed v1.1 in a SMF 2.1 Beta 3 forum, with default theme activated. Tweets are embed flawlessly, but I cannot quote messages through quick reply or use the WYSIWWYG editor with the package installed. If I uninstall it, then everything works OK again. Anyone with this problem too?
Title: Re: Auto Tweet Embed
Post by: vbgamer45 on January 21, 2020, 09:36:44 PM
Quoting the emebed tweets?
Title: Re: Auto Tweet Embed
Post by: Hamm9 on January 22, 2020, 04:31:19 AM
Quote from: vbgamer45 on January 21, 2020, 09:36:44 PM
Quoting the emebed tweets?

Quoting any message is impossible. I get a Loading message on the top that never goes away. The editor doesn't work either—no smileys, no font options.

I modified autotwitter.xml. First, I change the jQuery version from 2.1.1 to 3.1.1. But still the same. Deleting all the modification for the Load.php file solves the problem.
Title: Re: Auto Tweet Embed
Post by: Hamm9 on January 22, 2020, 04:38:32 AM
This is what I get on Web Console when I visit any thread from the forum with the package installed.


TypeError: $.sceditor is undefined topic,424.30.html:1010:5
    <anonymous> topic,424.30.html:1010
    jQuery 4
        j
        fireWith
        ready
        I
jQuery.Deferred exception: $(...).superfish is not a function @/foro/Themes/default/scripts/minified.js?beta21:460:390
j@https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js:2:29948
g/</k<@https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js:2:30262
undefined jquery.min.js:2:31525
TypeError: $(...).superfish is not a function minified.js:460:390
    <anonymous> /foro/Themes/default/scripts/minified.js?beta21:460
    jQuery 2
        j
        k
TypeError: oIframe is undefined 2 drafts.js:25:23
    init /foro/Themes/default/scripts/drafts.js?beta21:25
    <anonymous> /foro/Themes/default/scripts/drafts.js?beta21:15


When I click on Quote button, I get this:

TypeError: $(...).data(...) is undefined topic,424.30.html:1101:26
    onDocReceived topic,424.30.html:1101
    success minified.js:74
    jQuery 4
        j
        fireWith
        x
        b


None of these errors appear with the package uninstalled.
Title: Re: Auto Tweet Embed
Post by: wylekk on February 22, 2020, 04:29:45 AM
Try connecting like this

<script type="text/javascript" src="' . $settings['default_theme_url'] . '/scripts/jquery-3.2.1.min.js"></script>

or so
<script src="https://code.jquery.com/jquery-3.4.1.min.js" integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo=" crossorigin="anonymous"></script>
Title: Re: Auto Tweet Embed
Post by: spiros on March 31, 2020, 06:32:31 PM
I already have a version of jquery.min.js loading on my theme (v3.4.1, here (https://www.translatum.gr/forum/Themes/CustomSunRise/scripts/jquery.min.js)). Is it possible to remove/adapt the extra jquery call in this line in Load.php? I tried so, but the embed did not work then.

<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>

Post with embed here:  https://www.translatum.gr/forum/index.php?topic=977462.0
Title: Re: Auto Tweet Embed
Post by: vbgamer45 on April 26, 2020, 10:06:55 AM
Please fix I can't see the issue your bbc code is messed up.
Title: Re: Auto Tweet Embed
Post by: chinaren on April 26, 2020, 10:28:34 AM
Quote from: vbgamer45 on April 26, 2020, 10:06:55 AM
Please fix I can't see the issue your bbc code is messed up.


So sorry!  I was trying to fix the post but my internet started playing up, and it was driving me mad, so, total redo.


When I try to install this mod in the usual fashion, it says that is corrupted or not compatible with this version of SMF, as per the message below.


Now, my version of SMF is 2.1 RC2 which, according to the mod, is compatible.  So any ideas what i'm doing wrong?  'cos it's bound to be me.


Thank you!  :)


The package you are trying to download or install is either corrupt or not compatible with this version of SMF.
Title: Re: Auto Tweet Embed
Post by: vbgamer45 on April 26, 2020, 07:29:51 PM
Fixed should install for 2.1 RC2
Title: Re: Auto Tweet Embed
Post by: chinaren on April 27, 2020, 02:11:28 AM
Thank you!  You are a hero VBG!  :D
Title: Re: Auto Tweet Embed
Post by: vbgamer45 on April 27, 2020, 09:02:07 AM
Glad to help
Title: Re: Auto Tweet Embed
Post by: Rob Lightbody on May 08, 2020, 07:00:54 AM
Big fan of this Mod, but it seems to have stopped working recently?

Here's a post I made that includes some tweets - https://www.theqe2story.com/forum/index.php?topic=9313.msg108341#msg108341

In my error log, I can see errors such as this
Database Error: Incorrect string value: '\xF0\x9F\x87\xAC\xF0\x9F...' for column `theqesto_smf1`.`smf_tweet_cache`.`html` at row 1Apply Filter: Only show the errors from this fileFile: /home/theqesto/public_html/forum/tweet-cache.php

Thanks for any advice.
Title: Re: Auto Tweet Embed
Post by: vbgamer45 on May 08, 2020, 09:37:22 AM
Change the the character encoding of  the database table smf_tweet_cache to utf8 to solve I believe.
Title: Re: Auto Tweet Embed
Post by: Arantor on May 08, 2020, 10:02:53 AM
Think you need utf8mb4, and the queries to be on a connection that used SET NAMES utf8mb4; to make that work.
Title: Re: Auto Tweet Embed
Post by: vbgamer45 on May 08, 2020, 10:07:59 AM
Thanks for the tip!
Title: Re: Auto Tweet Embed
Post by: Rob Lightbody on May 08, 2020, 11:07:45 AM
Quote from: vbgamer45 on May 08, 2020, 09:37:22 AM
Change the the character encoding of  the database table smf_tweet_cache to utf8 to solve I believe.

Hi,

Thanks for replying.  I remember that I did have that problem once before, but its on UTF8 general now so don't know why i'm getting the error this time
Title: Re: Auto Tweet Embed
Post by: Arantor on May 08, 2020, 11:08:24 AM
Because UTF8 general only has a subset of real UTF-8, which emojis don't fit into. Hence the suggestion for utf8mb4.
Title: Re: Auto Tweet Embed
Post by: vbgamer45 on May 11, 2020, 06:45:10 PM
Update
2.0
+Added support to Emoji's thanks to Arantor for changes needed
Title: Re: Auto Tweet Embed
Post by: Rob Lightbody on May 13, 2020, 11:02:43 AM
Many thanks for the update.

I uninstalled 1.1 (including the data) and then reinstalled your new v2.0.

It is now no longer erroring, which is lovely, however I'm also not getting the thumbnail preview of the tweet either...

See - https://www.theqe2story.com/forum/index.php?topic=8675.0 and https://www.theqe2story.com/forum/index.php?topic=9164.0 for two random examples from my forum.
Title: Re: Auto Tweet Embed
Post by: vbgamer45 on May 13, 2020, 11:05:25 AM
Seems to load for me ok
Title: Re: Auto Tweet Embed
Post by: Rob Lightbody on May 13, 2020, 11:28:45 AM
Quote from: vbgamer45 on May 13, 2020, 11:05:25 AM
Seems to load for me ok

Me too now!  How strange!   Thats awesome though, thanks very much for your work on this package, its hugely appreciated.
Title: Re: Auto Tweet Embed
Post by: vbgamer45 on May 13, 2020, 11:57:57 AM
Glad to help. Probably was a cache issue. Had to wait for it to timeout.
Title: Re: Auto Tweet Embed
Post by: laboo9 on May 28, 2020, 07:11:06 PM
I installed the auto tweet embed a couple days ago.  Everything was working until this morning when the tweets stopped embedding as they look on twitter.  Now they have the text of the tweet along with hashtags, links to video, and link to pics with the actual link to the actual tweet underneath. 

I'm using 2.0.17.  I have tried uninstalling and reinstalling without any issues but the tweets still don't embed correctly.  Any ideas?
Title: Re: Auto Tweet Embed
Post by: vbgamer45 on May 28, 2020, 07:16:16 PM
Check your forums error log.
And your tweet-cache.php file permissions.
Title: Re: Auto Tweet Embed
Post by: laboo9 on May 28, 2020, 08:17:06 PM
the only error I'm getting is File:....../forums/Themes/default/languages/OharaYTEmbed.english.php (main sub template - eval?)

tweet-cache.php file permissions is 0666
Title: Re: Auto Tweet Embed
Post by: vbgamer45 on May 28, 2020, 08:23:42 PM
Do you have a link to the post?
Title: Re: Auto Tweet Embed
Post by: laboo9 on May 28, 2020, 08:35:02 PM
It's a private board.

http://www.hard2bhumble.net/forums/index.php?topic=13791.msg227105#msg227105
Title: Re: Auto Tweet Embed
Post by: vbgamer45 on May 28, 2020, 08:51:13 PM
Ah, that will be hard for me to check. Basically I would look in the console log to see if there are any javascript errors and also checking the response from tweet-cache in the network log.
Title: Re: Auto Tweet Embed
Post by: laboo9 on May 28, 2020, 09:57:54 PM
I'm pretty new to this stuff but is this what you are looking for?

<?php
/*
Rough take on Twitter oEmbed for VeloRooms
by L'arri : voici.l.arriviste@gmail.com
27 October 2014

Packaged and modified by SMFHacks.com -vbgamer45
*/

// I used SMF items where possible for database interactions and required includes.
global $ssi_guest_access;
$ssi_guest_access = 1;
require(dirname(__FILE__) . '/SSI.php');

global $smcFunc;

$_GET = filter_input_array(INPUT_GET, FILTER_SANITIZE_NUMBER_INT);
$qv  = $_GET['id'];
if (!empty($qv))
{
   check_cache($qv);
}
else
{
   echo '{"html":"<p style=\"color: #666; border: 1px dotted #666; padding: 5px; width: 490px;\">' . $txt['autotwitter_blankid'] . '</p>"}';
}

function check_cache($tweet)
{
   global  $smcFunc;
   
   if (!is_numeric($tweet))
      return;
   
   $request = $smcFunc['db_query']('','SELECT
      html from
   {db_prefix}tweet_cache
   where tweetid = {raw:tweet}',
   array(
      'tweet' => $tweet
      )
   );
   
   if ($smcFunc['db_num_rows']($request) == 0)
   {
      add_cache($tweet);
   }
   else
   {
      while ($row = $smcFunc['db_fetch_row']($request))
         echo '{"html" : "' . $row[0] .'"}';
   }      
   $smcFunc['db_free_result']($request);
   
}

function add_cache($tweet)
{
   global $smcFunc, $txt, $sourcedir;

   $twitterapi_url = "https://api.twitter.com/1.1/statuses/oembed.json?id=";
   $twitterapi_url = $twitterapi_url . $tweet;
   
   if (function_exists('curl_init'))
    {
        $curl = curl_init($twitterapi_url);
       curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
       curl_setopt($curl,CURLOPT_SSL_VERIFYPEER, FALSE);
       $response = curl_exec($curl);
       curl_close($curl);
    }
    else
    {
        require_once($sourcedir . '/Subs-Package.php');
        $response = fetch_web_data($twitterapi_url);
    }
   
   
   $json_content = json_decode($response, true);
   $json_content = preg_replace( "/\r|\n/", "", $json_content );
   
   $html = $json_content['html'];
   if (!empty($html))
   {

      $smcFunc['db_query']('', '
         SET NAMES {string:db_character_set}',
         array(
            'db_character_set' => 'utf8mb4',
         )
      );

      $request = $smcFunc['db_insert']('',
            '{db_prefix}tweet_cache',
            array(
               'tweetid' => 'raw', 'html' => 'text'
            ),
            array(
               $tweet, addslashes($html)
          ),
            array('tweetid','html')
         );
      echo '{"html" : "' . addslashes($html) .'"}';
   }
   else
   {
      echo '{"html":"<p style=\"color: #666; border: 1px dotted #666; padding: 5px; width: 490px;\">' . $txt['autotwitter_tweeterror'] . '</p>"}';
   }
   
}

?>
Title: Re: Auto Tweet Embed
Post by: vbgamer45 on May 28, 2020, 10:57:08 PM
No looking for javascript errors...
Title: Re: Auto Tweet Embed
Post by: pocttopus on May 29, 2020, 02:59:34 AM
Disable the Enhanced Tracking protection to your site from your browser.

(https://i.postimg.cc/Y2T056Vp/Screenshot-13.jpg)
Title: Re: Auto Tweet Embed
Post by: kilk on June 09, 2020, 04:07:27 PM
I havent had any issues with this mod, just solid af, thank you again vbgamer
Title: Re: Auto Tweet Embed
Post by: natcip on August 02, 2020, 10:38:44 AM
For whatever reason some tweets won't embed at all, like in this post (http://www.brandysource.net/index.php?topic=49516.msg2594219#msg2594219), even though the link structure is identical to other posts where it did embed. :-\
Title: Re: Auto Tweet Embed
Post by: vbgamer45 on August 02, 2020, 10:57:21 AM
Looks like i get a database error are you using latest version?
http://www.brandysource.net/tweet-cache.php?id=1289643269563904002
If so post the db error from your logs
Title: Re: Auto Tweet Embed
Post by: natcip on August 02, 2020, 01:36:02 PM
Yes, I've just updated it in May.
And there are no error log entries.
Title: Re: Auto Tweet Embed
Post by: vbgamer45 on August 02, 2020, 02:08:03 PM
What happens when you click that link above as admin?
I want to see the message returned.
Title: Re: Auto Tweet Embed
Post by: natcip on August 03, 2020, 06:21:07 AM
Incorrect string value: '\xF0\x9F\x92\x80 <...' for column `brandyso_sql1`.`brandy4f_sql1_smf_tweet_cache`.`html` at row 1
File: /home/www/brandyso/tweet-cache.php
Line: 93
Title: Re: Auto Tweet Embed
Post by: Arantor on August 03, 2020, 06:22:59 AM
Can't store emoji... if the mod pushed it through $smcFunc['htmlspecialchars'] this would be fine.
Title: Re: Auto Tweet Embed
Post by: vbgamer45 on August 03, 2020, 06:55:29 AM
Would that break the html response? Thinking I could do that but then do  un_htmlspecialchars to get right content?


$html = $json_content['html'];
if (!empty($html))
{

$smcFunc['db_query']('', '
SET NAMES {string:db_character_set}',
array(
'db_character_set' => 'utf8mb4',
)
);

$request = $smcFunc['db_insert']('',
'{db_prefix}tweet_cache',
array(
'tweetid' => 'raw', 'html' => 'text'
),
array(
$tweet, addslashes($html)
),
array('tweetid','html')
);
echo '{"html" : "' . addslashes($html) .'"}';
}
Title: Re: Auto Tweet Embed
Post by: Arantor on August 03, 2020, 07:00:43 AM
You only need to htmlspecialchars it before sending to the database (because even though you have a SET NAMES call, none of that matters if the underlying table isn't also utf8mb4 - which by evidence of the above, it is not) and I *think* you can safely un_htmlspecialchars on the way back.

Alternatively, borrow the routine from $smcFunc that fixes UTF-8 (it entity encodes all emoji as numeric-form entities) and just html_entity_decode on the way back?

Though entities are valid HTML so...
Title: Re: Auto Tweet Embed
Post by: vbgamer45 on August 03, 2020, 07:07:26 AM
I had it setup on the field level on the install

ALTER TABLE {db_prefix}tweet_cache CHANGE html html text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci



Quote from: natcip on August 03, 2020, 06:21:07 AM
Incorrect string value: '\xF0\x9F\x92\x80 <...' for column `brandyso_sql1`.`brandy4f_sql1_smf_tweet_cache`.`html` at row 1
File: /home/www/brandyso/tweet-cache.php
Line: 93

Try the attached file and see if it helps
Copy to root of your SMF install and make sure right permissions are set.

Title: Re: Auto Tweet Embed
Post by: Arantor on August 03, 2020, 07:15:31 AM
@vbgamer45: if someone ever does a UTF-8 conversion in SMF, it'll force convert it to non-mb4, in spite of what the database says. Things are better in 2.1.
Title: Re: Auto Tweet Embed
Post by: vbgamer45 on August 03, 2020, 07:31:39 AM
Bah, didn't know that.
Title: Re: Auto Tweet Embed
Post by: natcip on August 04, 2020, 06:17:04 AM
Quote from: vbgamer45 on August 03, 2020, 07:07:26 AM
I had it setup on the field level on the install

ALTER TABLE {db_prefix}tweet_cache CHANGE html html text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci



Quote from: natcip on August 03, 2020, 06:21:07 AM
Incorrect string value: '\xF0\x9F\x92\x80 <...' for column `brandyso_sql1`.`brandy4f_sql1_smf_tweet_cache`.`html` at row 1
File: /home/www/brandyso/tweet-cache.php
Line: 93

Try the attached file and see if it helps
Copy to root of your SMF install and make sure right permissions are set.
Thank you for this. Unfortunately no change. :( File is set to 644.
Title: Re: Auto Tweet Embed
Post by: vbgamer45 on August 04, 2020, 09:26:05 AM
Can you rerun this query on your database

ALTER TABLE smf_tweet_cache CHANGE html html text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci
Title: Re: Auto Tweet Embed
Post by: natcip on August 05, 2020, 06:08:20 AM
Just did it
tweet-cache.php now shows this
{"html":"

Tweet error (blank ID)
"}

But the tweets still don't embed
Title: Re: Auto Tweet Embed
Post by: chrishicks on August 12, 2020, 07:25:54 PM
Is there a way to have the embeds use a dark theme instead of the white? Like this:

https://i.imgur.com/DnigklQ.png

It's not a huge deal I was just curious since my theme is entirely dark colored.
Title: Re: Auto Tweet Embed
Post by: vbgamer45 on August 12, 2020, 07:39:36 PM
Maybe might have to tweak the embed code.
Title: Re: Auto Tweet Embed
Post by: natcip on May 29, 2021, 04:15:13 PM
Hi there,
I just tried posting a tweet link and instead of showing an embedded tweet, the post literally looks like this:
<blockquote class="twitter-tweet"><p lang="en" dir="ltr">I digress .</p>&mdash; SZA (@sza) <a href="https://twitter.com/sza/status/1398527644115738624?ref_src=twsrc%5Etfw">May 29, 2021</a></blockquote><script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>https://twitter.com/sza/status/1398527644115738624
Title: Re: Auto Tweet Embed
Post by: vbgamer45 on May 29, 2021, 08:11:31 PM
What mods to have insalled?

that is the right code except it is showing the html instead of running it.
Title: Re: Auto Tweet Embed
Post by: natcip on May 30, 2021, 07:51:06 AM
Quote from: vbgamer45 on May 29, 2021, 08:11:31 PM
What mods to have insalled?
Simple Audio Video Embedder
Yet Another YouTube BBCode Tag
Yet Another Spoiler Mod
Soundcloud BBcode
NiceTooltips

Also, I just checked my test post from yesterday. Now it simply shows the tweet link, not the html code. ???