Link to the mod (https://custom.simplemachines.org/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
4.0.3
!Handle x.com better, api workaround.
4.0.2
+Better handling of query string
4.0.1
+Support x.com links
4.0
!Changed url for the api.
3.0
+Added support for twitter urls with data after the ? sign thanks to live627
2.1
!Updated jquery version to fix issues in SMF 2.1.x now uses save version as 2.1
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
excellent work!
great and awesome works perfect...
Glad you enjoy the mod!
Excellent, thanks again for developing, improving and packaging this.
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>
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 :)
You just need to paste the link of the tweet (like: https://twitter.com/CNNMoney/status/604905917272891392) - Modification does the rest for you.
I tried that and all I got was the link and nothing else... :(
I installed the mod, it embeds but w/o styling. Seems like a problem from twitter side.
Thank god... means I am not stupid ;D
Will see if the mod designer can do anything.. :)
Thanks for your help!
Kriss :)
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.
As I have never heard of those I will presume no.. :D I have a like mod though
Kriss :)
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?
What kind of language set are you using?
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.
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 ?
My tweet dont embed
(http://img.prntscr.com/img?url=http://i.imgur.com/qbZVTlq.png)
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?
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
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
Well... I have the emoticon issue too... I do not care for the moment :-D
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?
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.
Update
1.0.1
!Updated jquery library to use https
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)
Quote from: natcip
I got an error message when I ran the install.php. :-\
And you can't say what that error message was?
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)
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?
What is an exact tweet link on your forum that is not embedding?
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
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.
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!
Glad to help. I went U of I Champaign as well.
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!
You have the same error has previous poster
http://forum.mkreef.com/tweet-cache.php
Fix the file permissions
Make it 755 or 644
The permissions are already 755 and it won't work with 644 either. :(
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.
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
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
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? :(
I would try to get your hosting provider to look into then they may have an idea.
SOLVED!
Issue was on file without 755 permission.
Thanks!
Glad you have it working!
This mod stop embedding. please how can I fix the error.
Link to forum that has the twitter post
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/
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]
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
as it open ???
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]
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.
Yeah I would ask someone for help. The error is not from this mod but from another script you have.
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
Sorry i don't have time I would ask on the help wanted forum.
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:)
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
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.
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
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
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!
I would have to see examples.
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!
Still no response? :o
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>-и.
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
No advice? ??? :-\
Not at this time not sure what else to do.
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.
Still no updates about the issue why some tweets are not embedded? ??? :-[
None
Why this mod is not working at all? The tweets are not embeded. :-[
http://f1legacy.com/index.php?topic=3.0
File permission issue page not displayed
http://f1legacy.com/tweet-cache.php?id=903567377220210688
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.
Try 777 or check file owner.
Can you give me tips how to find file owner?
I changed directly via filezilla on ftp to 777 but no change.
I would contact your host or search on google.
I tried with 755 and it worked.
I don't know why 777 does not going properly.
Thanks vbgamer45! :)
How would I remove the twitter link from automatically being added below the tweet?
You may have to modify the mods code if there is no setting for it.
Working well "out of the box" on 2.0.15. Thanks.
Glad you enjoy it.
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
Got a couple of change requests if possible.
1. Auto-embed mobile.twitter.com links.
2. Auto-hide query strings.
TIA
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!!
Doesn't install or does not work?
It installs correctly but it just doesn't do anything
Link to a post with twitter link that it is not doing anything.
Here you go VB: https://ultrafusedthemes.com/smf/index.php?topic=4.0
Could it be because my test environment is https?
You have a file permission error on
https://ultrafusedthemes.com/smf/tweet-cache.php?id=996227930161401857
Check file permissions for that file
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
If not check your apache server error log with hostgator
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?
I found it - attached.
None of those errors seems to be related to that file.
Try permissions of 644 on the file.
Unfortunately it didn't help.
I set the tweet-cache.php to 644 and the whole folder is 755
Out of ideas. I have only see that happen due to file ownership issues.
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.
The attached error log is from the current live site that is using this mod. Any ideas?
Thanks that may help
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?
Try some other twitter urls I want to see if it is just that one or all of them.
https://ultrafusedthemes.com/index.php?topic=3.0
We have used this in the past http://custom.simplemachines.org/mods/index.php?mod=3837
Suki released a new one too?
Thanks but I'm probably going to go with NIBOGO's Auto Media Embedder.
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!
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
Emojis don't seem to be supported.
+Added install support for SMF 2.1 RC1
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
Will check it out.
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? :)
haven't had time to look
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
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?
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.
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?
Try this version and see if it helps
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.
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.
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.
Sure I would like to see it.
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?
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?
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.
Upload the package to https://www.smfhacks.com/smf-package-parser.html
Then check that all the edits have been reversed.
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.
It tells you what files were edited by the modification. Just make sure all the modification code is removed.
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)
See the edit it makes load.php and make sure that edit does not exist.
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
Edit Sources/Loads.php and remove the code added by this mod.
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?
Can you please edit it and send me back? I know I want so much. But, please.
https://files.fm/f/vkygkdsp
yes, please attach to this post
Quote from: vbgamer45 on October 30, 2019, 03:03:39 PM
yes, please attach to this post
Here you go. Thank you.
Updated file attached
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
Try new posts with twitter link.
Might be an issue with old posts.
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.
It might not be this mod in this case....
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.
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.
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.
This mod broke something on the forum and whatever I do now, it doesn't ever work.
Not sure, at this point either. If mod is removed it shouldn't cause any new issues.
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
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)
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.
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.
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.
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...
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.
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
I just hope anyone could assist me on this
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.
Hmm, I would need to add support for the mod for the ?s= query string.
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?
Quoting the emebed tweets?
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.
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.
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>
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
Please fix I can't see the issue your bbc code is messed up.
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.
Fixed should install for 2.1 RC2
Thank you! You are a hero VBG! :D
Glad to help
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.
Change the the character encoding of the database table smf_tweet_cache to utf8 to solve I believe.
Think you need utf8mb4, and the queries to be on a connection that used SET NAMES utf8mb4; to make that work.
Thanks for the tip!
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
Because UTF8 general only has a subset of real UTF-8, which emojis don't fit into. Hence the suggestion for utf8mb4.
Update
2.0
+Added support to Emoji's thanks to Arantor for changes needed
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.
Seems to load for me ok
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.
Glad to help. Probably was a cache issue. Had to wait for it to timeout.
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?
Check your forums error log.
And your tweet-cache.php file permissions.
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
Do you have a link to the post?
It's a private board.
http://www.hard2bhumble.net/forums/index.php?topic=13791.msg227105#msg227105
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.
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 :
[email protected]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>"}';
}
}
?>
No looking for javascript errors...
Disable the Enhanced Tracking protection to your site from your browser.
(https://i.postimg.cc/Y2T056Vp/Screenshot-13.jpg)
I havent had any issues with this mod, just solid af, thank you again vbgamer
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. :-\
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
Yes, I've just updated it in May.
And there are no error log entries.
What happens when you click that link above as admin?
I want to see the message returned.
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
Can't store emoji... if the mod pushed it through $smcFunc['htmlspecialchars'] this would be fine.
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) .'"}';
}
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...
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.
@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.
Bah, didn't know that.
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.
Can you rerun this query on your database
ALTER TABLE smf_tweet_cache CHANGE html html text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci
Just did it
tweet-cache.php now shows this
{"html":"
Tweet error (blank ID)
"}
But the tweets still don't embed
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.
Maybe might have to tweak the embed code.
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>— 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
What mods to have insalled?
that is the right code except it is showing the html instead of running it.
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. ???
Update
2.1
!Updated jquery version to fix issues in SMF 2.1.x now uses save version as 2.1
So I had installed an older version (2.0) (it had a different name? Auto Twitter Embed instead of Auto Tweet Embed?).
I installed 2.1, thinking it'd overwrite the older one. Now I'm having embedded tweets appearing twice, and in my Package Manager I have only Auto Twitter Embed 2.0 without an uninstall option (only list files/delete)... weird? Any ideas?
Uninstall then run the parser at https://www.smfhacks.com/smf-package-parser.html on the mod to find the edits to remove the old code as well.
Yeah, thought so myself, however as I said there's no Uninstall option even if I tried emulating older versions... Really weird.
Strange. Luckly there is not many edits the mod makes. Main one is the edits to load.php
Ok then I'll take it out by hand... Cheers.
Btw, since the "unknown status" one shown in the Package Manager is 2.0, what version should I emultate to try to remove it? Instead of trying blind...
Any SMF 2.0 or 2.1 version should be ok.
This is weird, maybe I've come across some SMF bug:
Tried emulating - still no uninstalling option. I went in through FTP and deleted the files under Packages manually, and THEN it showed as "installed" in the package manager, and I was able to uninstall.
Verified that Tweets don't get embedded.
Installed the package again, it went fine, and now I'm getting double embeds again :D Looks like I'll have to remove the code manually indeed...
I had to collate my database to convert all tables (not sure if that is an issue).
Lately all the auto embedded tweets look like this when I post a link
(https://i.imgur.com/xx5BXyh.png)
When I checked the row in the database
MySQL returned an empty result set (i.e. zero rows). (Query took 0.0002 seconds.)
Can you copy that tweet url and post it here will test on my site.
What colation did you change it to in the database and smf version
Quote from: vbgamer45 on June 17, 2022, 12:25:50 PMCan you copy that tweet url and post it here will test on my site.
What colation did you change it to in the database and smf version
Here is one that isn't working, but I have this issue with many of the Tweets
https://twitter.com/BobbySkinner_/status/1537803855769088000?s=20&t=EVOiClKrwR5RJFDkGVLx9g
Here are two more
https://twitter.com/jhilliard47/status/1537890397451538436?s=21&t=0AHC3Vz6Yknjbkc-80Gjdw
https://twitter.com/nypost_schwartz/status/1537890825685741570?s=21&t=0AHC3Vz6Yknjbkc-80Gjdw
Do they work if you take off the data from the ? onward?
Quote from: vbgamer45 on June 18, 2022, 11:34:29 AMDo they work if you take off the data from the ? onward?
Yes, that does seem to fix the issue
Quote from: vbgamer45 on June 18, 2022, 11:34:29 AMDo they work if you take off the data from the ? onward?
Any chance there will be a fix for the "?" issue?
Update!
3.0
+Added support for twitter urls with data after the ? sign thanks to live627
Quote from: vbgamer45 on June 27, 2022, 12:00:41 PMUpdate!
3.0
+Added support for twitter urls with data after the ? sign thanks to live627
uninstall and then install the new one?
Yes exactly
Quote from: vbgamer45 on June 27, 2022, 12:00:41 PMUpdate!
3.0
+Added support for twitter urls with data after the ? sign thanks to live627
Not sure what the problem is, but this link failed
https://twitter.com/art_stapleton/status/1541829801463382016?s=20&t=3fzQK7KQdlejtclBN34nQg
When I removed everything after and including the "?" it worked
I checked my package manager and here is the version:
Auto Twitter Embed 3.0
Maybe this Mod already does this, but it would be nice if the Post would be 'cached' infinitly.
They are cached forever by default.
Found my way to this mod when I discovered SAVE didn't handle Twitter. Not a biggie.
However, can't seem to get this to work. Don't rule out user-error, but it installs without errors and I don't get errors when loading the page. Simply nothing from Twitter is embedded... I just get the URL.
Link to example:
https://www.turtlekickers.com/index.php?topic=195.msg257#msg257
Other mods installed:
Merge Double Posts
Curve2 Color Changer
SMF 2.1.2 Update
Inter Font for SMF
SMF Trader System
FA Board Icons
ST Shop
TinyPortal
Block Proxy VPN On Registration
SMF Arcade
Quick Spoiler
Global Headers Footers
Battle
Mod Version Checker
Similar Topics
Simple Audio Video Embedder
Stop Forum Spam
FancyBox 4 SMF
Simple Referrals
Topic Rating Bar
Forum Width Setting
Email Obfuscator
Auto Twitter Embed
RSS Feed Icon
File permission issue on https://www.turtlekickers.com/tweet-cache.php
needs to be 755
Quote from: vbgamer45 on July 22, 2022, 03:13:26 PMFile permission issue on https://www.turtlekickers.com/tweet-cache.php
needs to be 755
That did it! Thanks (as always... you've been consistently helpful and mind-bogglingly patient with people)
Any update if the issue where links with a "?" will not embed?
Hello everyone!
I'm new to the forum and I've got some weird issues with this mod.
Currently I'm working on a new theme for the new SMF 2.1 update and sadly having problems with the Tweet auto embed. I uninstalled the old version and deleted the package and then installed version 3.0, the latest one if I'm not mistaken. I use Firefox (add-ons disabled) with the latest updates and also tried other browsers too.
These are the issues I'm having (even before installing version 3.0):
- Most tweets just won't get fetched at all, nothing happens, no matter if I remove the content starting with "?" or not.
- Sometimes tweets do get embedded but when they are, they're displayed twice.
- When I edit a post that had a working embedded Tweet in it, it stops being embedded once I save the edited post. Refreshing the page won't help. You just see the url again.
- Seems like when I add anything else beyond the Tweet itself in a post, the Tweet won't get embedded.
I went back to the SMF default theme to see whether it's an issue with my customized one but it shows the same behavior.
Here's a tweet I used that worked once and now stopped working for some reason
(edit: SMF tells me I'm not allowed to share external links)
It worked one time, got shown twice and when I edited it and hit "save", it stopped working again. Not even a new, separate reply with the same tweet got embedded.
(https://abload.de/img/doubletweettycbr.jpg)
(https://abload.de/img/tweetsourcezjdmi.png)
Has anyone of you encountered similar issues as well?
Sorry I have to bump this: Does anyone have an idea why this is happening or can reproduce these issues?
1. If you have a lot of tweets you might be rated limited from twitter.
2. Check that the mod was not installed twice if every post has two of the twitter posts inside it.
3. 4. Haven't seen yet.
Thanks, vbGamer, for your quick response.
- Hm, I don't know about the number of tweets shouldn't be that many.
- We are currently running a public forum with SMF 2.0.19 and a test forum with the latest 2.1.2 version. On the old forum tweets work as intented, only the test forum won't work. Is there a way for non-hosts (me) to see possible duplicates of mods? In the Admin section, I can only see this mod once.
- / 4. even happen when I go back to the SMF default theme.
Edit: I uninstalled the mod an re-installed it including checkin this box "Drop table "smf_tweet_cache" and deleteing the package itself. After installation, the tweets that weren't showing before anymore were now shown again. But again, displayed twice and the moment I edit the post the Tweet won't get fetched anymore. All pretty mysterious.
Quote from: vbgamer45 on September 06, 2022, 09:02:23 AMCheck that the mod was not installed twice if every post has two of the twitter posts inside it.
Quote from: Julius_2000 on September 06, 2022, 10:13:41 AMWe are currently running a public forum with SMF 2.0.19 and a test forum with the latest 2.1.2 version. On the old forum tweets work as intented, only the test forum won't work. Is there a way for non-hosts (me) to see possible duplicates of mods? In the Admin section, I can only see this mod once.
You would have to look at the file edits this mod does and make sure the changes weren't made more than once.
Quote from: Steve on September 07, 2022, 07:20:24 AMQuote from: vbgamer45 on September 06, 2022, 09:02:23 AMCheck that the mod was not installed twice if every post has two of the twitter posts inside it.
Quote from: Julius_2000 on September 06, 2022, 10:13:41 AMWe are currently running a public forum with SMF 2.0.19 and a test forum with the latest 2.1.2 version. On the old forum tweets work as intented, only the test forum won't work. Is there a way for non-hosts (me) to see possible duplicates of mods? In the Admin section, I can only see this mod once.
You would have to look at the file edits this mod does and make sure the changes weren't made more than once.
Oh, I think you pointed to something. I just went back to the mod page and looked at the modfications it' does to php files using "parse". And it looks like there's a double entry in the load.php
Quote// Auto Embed Twitter
global $boardurl;
if (!function_exists("set_tld_regex"))
$context['html_headers'] .= '
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>';
$context['html_headers'] .= '
<script type="text/javascript">
$(document).ready(function() {
var oTwitter = $(\'a[href*="twitter.com"][href*="/status"]\');
if (oTwitter.length > 0) {
oTwitter.each(function() {
var oHolder = $(this);
var sStr = $(this).attr(\'href\');
sStr = sStr.replace(/\/+$/, "");
sStr = sStr.substr(sStr.lastIndexOf(\'/\') + 1);
$.getJSON("' . $boardurl .'/tweet-cache.php?id=" + sStr, function(data) {
oHolder.before(data.html);
});
});
}
});
</script>';
//end Auto Embed Twitter
// Auto Embed Twitter
global $boardurl;
if (!function_exists("set_tld_regex"))
$context['html_headers'] .= '
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>';
$context['html_headers'] .= '
<script type="text/javascript">
$(document).ready(function() {
var oTwitter = $(\'a[href*="twitter.com"][href*="/status"]\');
if (oTwitter.length > 0) {
oTwitter.each(function() {
var oHolder = $(this);
var sStr = $(this).attr(\'href\');
sStr = sStr.replace(/\/+$/, "");
sStr = sStr.substr(sStr.lastIndexOf(\'/\') + 1);
$.getJSON("' . $boardurl .'/tweet-cache.php?id=" + sStr, function(data) {
oHolder.before(data.html);
});
});
}
});
</script>';
//end Auto Embed Twitter
Could I delete one of these entries without corrupting the rest?
Also, there's a double entry in the modifications.english.php
Quote// 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
One is at the beginning of the code, the other at the end. Can I delete the second one, too?
Edit: I think that did the trick! Tweets now embed only once.
The issue with editing posts still remains. Tweets won't get shown when I edit any post, even if I only save without editing anything at all.
Nice, glad that solved one of the bugs!
It sounds like you went ahead and deleted the duplicates but if not, the answer to both your questions is yes. :)
Ha, Steve, yes I was bold and tried it out. I have access to the ftp server so I made a backup before modifying the phps in case it wouldn't work out.
Thank you guys, you've all been really helpful!!
Maybe we need to set up the new forum all over again to get rid of some things like that.
If this is a brand new forum, that probably wouldn't be a bad idea.
https://wiki.simplemachines.org/smf/How_to_upload_a_fresh_set_of_files
Do a backup and then you should be able to re-install this mod with no problems.
I can't recreate the edit issue on my SMF 2.1.x board. I am able to edit the post either full edit or quick edit and the embeding still works.
Thank you so much guys. I think there might have gone something wrong while fiddeling with the code or whatever, given that there was also a double entry in the load.php etc.
Shouldn't be too hard to set it up fresh and then upload the theme and mods again, I hope.
If you've got all the double entries removed, it should be working.
Hello,
I was using Auto Twitter Embed 1.1 with SMF 2.0.15.
I noticed that the tweets were not embedding for some time. So I updated the mod to 3.0 version.
Tweets are still not embedding,
no entries at all in smf_tweets_cache table,
and there are 503 errors in the console (for every tweet link).
Like:
Quotejquery is already loaded with version: 3.6.0
result of version check: 1
Failed to load resource: the server responded with a status of 503 (),
https://myforumsite.com/forum/tweet-cache.php?id=1603079336277458944
Before anyone else asks, see my question to you here: https://www.simplemachines.org/community/index.php?msg=4141709
Check file permissions on tweet-cache.php they need to be adjusted.
Quote from: vbgamer45 on December 20, 2022, 10:36:42 AMCheck file permissions on tweet-cache.php they need to be adjusted.
Thank you vbgamer. File permissions were fine (666). It looks it was the PHP version. It was 7.1 and upon upgrading to 7.4 tweets started displaying. Now I have to deal with its side effects (Depreciated create_function errors etc.), which brings me to Steve's question, it is time for 2.1.3 :)
Btw, I am getting lots of Content blocker errors on Safari. Because of loading external content in an iframe. Any workaround about this?
QuoteContent blocker prevented frame displaying https://myforum.com/forum/index.php?topic=6313.msg1805094;boardseen#new from loading a resource from https://syndication.twitter.com/i/jot/embeds?
I have installed this mod successfully, according to the messages I received. But the tweets basically look like links.
Yes, my version (2.1.3) is not officially supported, but can there be something I can check out that could be fixed to get this to work.
Thank you.
I would check your javascript error log in your browser to see if any errors that might be related on a page with twitter links
Hello there! The mod works absolutely fine for me, so I have an opposite problem :D
Is it possible to disable embedding for the specific link (or post)?
What I want is the standard forum behavior for handling url, i.e. I'd like to be able to use the url bb code for twitter links, like this:
[url=https://twitter.com/bbcworld/status/1610105681285111808]text[/url]
Any ideas guys? :)
Not possible currently.
Hi! i tried this mod a in a fresh installation of SMF 2.1.3, posted a twitter link and nothing happen, i checked the permissions of the file tweet-cache.php and changed from 666 to 777, but nothing happend too, no error logs too.
I would have to check if this still works. Twitter might have changed some stuff...
Well i tried in a smf 2.1.3 installed in localhost and the autoembed works fine, looks i have some issues with my hosting about this mod
Any idea what i'm missing / is wrong in the hosting?
Thanks!
Well, i have asked to my hosting service and they have answered me that this mod is not compatible with my environment, but that this other mod works https://custom.simplemachines.org/index.php?mod=3837 , to use that one.
Recently installed 3.0 of this mod, initially installed on SMF 2.0.19 and upgraded to 2.1.3 but same issue - tweets with ? in the URL don't load, they give a "Tweet error (does not exist)" directly above the URL. If I modify the post and remove the ? and everything after it - loads no problem. I know 3.0 is supposed to fix so I likely missed a step in the install/config.
Anything I should check? Tried 777/775/755 on tweet-cache.php, SELinux is not running.
It's a known bug i guess last fix didn't work for now remove after the ?
Hi
@vbgamer45,
We noticed that lots of most recent tweets do not embed any longer. Meanwhile, older tweets do still get displayed, though. Can anyone replicate this?
Here are two examples:
This works:
https://twitter.com/ChemBros/status/616702940934377472
That doesn't:
https://twitter.com/ChemBros/status/1671587253066297344
Quote from: Julius_2000 on June 21, 2023, 06:16:31 PMHi @vbgamer45,
We noticed that lots of most recent tweets do not embed any longer. Meanwhile, older tweets do still get displayed, though. Can anyone replicate this?
Here are two examples:
This works:
https://twitter.com/ChemBros/status/616702940934377472
That doesn't:
https://twitter.com/ChemBros/status/1671587253066297344
For me it does work on my forum...
https://www.cpcwiki.eu/forum/cpcwiki-discussion/test-20533/new/#new
Hm. Weird. I don't know how to tackle this. Old, already posted Tweets get displayed, new ones just won't get fetched.
I tried uninstalling and re-installing, checked the php files that would be changed by the mod for redundant code, and I tested it on a test forum with only these mods installed: Spoiler, Optimus, ThemeToggle and the latest 2.1.4 update.
Can you post link?
Hi,
This is a topic which contains lots of Tweet embeds. I made a comparison post of an old Tweet from its first page and the non-working one I mentioned above:
https://forum.thechembase.com/index.php?msg=32791
Can you try putting it into a separate post?
I split my post
https://forum.thechembase.com/index.php/topic,3283.0.html
Another strange thing: I just uninstalled and deleted the mod and uploaded a "fresh" version (it's the same version actually). But now, none of the tweets get fetched at all. Checked load.php and Modifications.english.php, all contain the required code. Tweet-cache.php is also in the root directory.
Doesn't even work on a vanilla Default theme..
Man, this gives me headaches..
Edit:
My error log on the ftp server shows this message multiple times:
Quote[Thu Jun 22 11:07:54.903700 2023]
[proxy_fcgi:error] [pid redacted:tid #]
[remote redacted] AH01071: Got error 'PHP message: PHP Fatal error: Uncaught TypeError: Cannot access offset of type string on string in /usr/home/myforum/data2/tweet-cache.php:82\nStack trace:\n#0 /usr/home/myforum/data2/tweet-cache.php(46): add_cache()\n#1 /usr/home/myforum/data2/tweet-cache.php(21): check_cache()\n#2 {main}\n thrown in /usr/home/myforum/data2/tweet-cache.php on line 82', referer: https://test.myForum.com/index.php/topic,3007.msg28826.html
Actually I meant putting the problematic tweet into its own post.
On the link you provided, fwiw I still see the first tweet perfectly.
I deleted the working one.
Ah yeah it fails by itself too, damn. I asked for it because some versions back only the first tweet in a post would embed for us...
Are you able to check the server error log to see if there's a similar error like the one above noted?
Unfortunately not for a few days but since for me it embeds fine I doubt I'll find anything...
Do you happen to know what php version you use? We've got 8.2.3 running at the moment.
Posted an update that might help
4.0
!Updated the api call for twitter. Also better handling if no content returned.
Thank you, that's much appreciated. Before I un- & re-installed v3.0, some older tweets were still working. Now, no tweet gets fetched at all (I believe I checked the "deleted all associated files" ).
Unfortunately, v4.0 is also not working on our test forum. Well, not quite, at least I now get a "Tweet error (does not exist").
Do you have curl installed?
As far as I can see in the mods, no. And I believe we never had.
Edit:I see the following in the PHP info tab in admin:
cURL support enabled
cURL Information 7.87.0
....
(there's more info in that segment)
We get a lot of notes like this in the error log for tweets:
Quote[Thu Jun 22 11:07:54.903700 2023]
[proxy_fcgi:error] [pid redacted:tid #]
[remote redacted] AH01071: Got error 'PHP message: PHP Fatal error: Uncaught TypeError: Cannot access offset of type string on string in /usr/home/myforum/data2/tweet-cache.php:82\nStack trace:\n#0 /usr/home/myforum/data2/tweet-cache.php(46): add_cache()\n#1 /usr/home/myforum/data2/tweet-cache.php(21): check_cache()\n#2 {main}\n thrown in /usr/home/myforum/data2/tweet-cache.php on line 82', referer: https://test.myforum.com/index.php/topic,3007.msg28826.html
Can you make sense of what's in there? Like
"Cannot access offset of type string..."Could it be that the tweets that are still working on our public forum are just cached and that's why we are still seeing them? The test forum won't display anything any longer after the un-/reinstallation except for the error message.
That error was fixed in the last update. Only returned if json from the twitter api could not be called.
Yes, it could be from cached tweets.
Your webhost could be blocking an external fetch?
Quote from: vbgamer45 on June 23, 2023, 09:17:39 AMYour webhost could be blocking an external fetch?
I'll have to ask the owner. Could I point him to anything specific setting-wise? Can I look that up myself in the php info tab in "admin" perhaps?
Try to do a curl https://publish.twitter.com/oembed?url=https://twitter.com/chesscom/status/1672371454053085185
From the server
and see what it returns from the command line.
Quote from: vbgamer45 on June 23, 2023, 09:17:39 AMYour webhost could be blocking an external fetch?
No, I'm not blocking anything. But the higher-level provider also blocks, so:
Quote from: vbgamer45 on June 24, 2023, 10:11:46 AMTry to do a curl https://publish.twitter.com/oembed?url=https://twitter.com/chesscom/status/1672371454053085185
From the server
and see what it returns from the command line.
It will return nothing, Twitter is blocked in Russia.
P.S. But it's blocked more than a year, so something changed last month in Twitter API or code of the mod.
Quote from: vbgamer45 on June 24, 2023, 10:11:46 AMTry to do a curl https://publish.twitter.com/oembed?url=https://twitter.com/chesscom/status/1672371454053085185
From the server
and see what it returns from the command line.
What Planet-Dust wrote: He can't use the link as Twitter is blocked in Russia. But we were able to get Tweets embedded up until like a month ago or so, perhaps after we updated to 2.1.4 and related software (php etc.).
If your host is in a country that blocks twitter then the mod would not work.
So we were lucky then when it worked all this time I guess.. Too bad.
What changes this mod makes and which files? Does it modify database?
I want to test this, but I don't wanna mess my forum, so I probably have to make proper backups first..
Yes database changes new table you can check the mod site for the files it changes.
Ok. Thanks. I will check.
I have never installed mods to my forum.
Does smf have automated uninstall for mods which reverts all changed/added lines in files and database?
File modifications yes as long as mod is coded right. And it depends if you install mods after the mod. Normally you should uninstall the mods installed after first. If it does file modifications.
Database if using SMF's database functions calls. There is an option to uninstall data. Not all mods support this.
I can't get it working. Mod install went through without problems, no errors. I checked files and those are okay. Apache error logs are clean.. but when I post twitter link, it just show the twitter link in post. :-\
What I am doing wrong? :-[
I don't know is this related, but has Twitter made some changes viewing content without logged in, because I can't see anything anymore?
Check your javascript error console, console log.
Quote from: vbgamer45 on June 30, 2023, 02:30:56 PMCheck your javascript error console, console log.
How I can check that? I have firefox..
Bing it/Google it is probably either site or javascript issue.
I found it, no errors.. :-\
then it is probably a host/server issue. not supporting fetching via curl or fsockopen to download remote
It is redirecting every request to login page.. So i believe that your code is working fine, but Musk-******head has blocked everybody if not logged in and cant get tweet. Maybe it is temporary block..
curl https://twitter.com/i/web/status/1674677315073351681
Found. Redirecting to /i/flow/login?redirect_after_login=%2Fi%2Fweb%2Fstatus%2F1674677315073351681
Wonder why xenforo tweet embeds are still working in another forum..
yeah....i think might be due to musk since you can't view tweets now without login.
Quote from: vbgamer45 on July 01, 2023, 02:20:08 AMyeah....i think might be due to musk since you can't view tweets now without login.
Every month changes now...
From being able to read/view a tweet, to being able to browse the entire site without login. And now back to complete restriction, a bit ridiculous.
Any ideas why xenforo embeds are still working?
Is there some paid API which they use? I noticed that some tweets are blocked in xenforo too, but not everything..
no idea would have to see the code.
They could be caching old tweets. Or hitting an endpoint/location that doesn't require logins yet.
I'm still able to embed new tweets by using google search and then copying the status link that is provided in the dotted context menu of the google search result card.
twitter 1.png
twitter 2.png
This is of course a cumbersome way, especially when it comes to finding most recent content but at least it works so far.
By the way, we were able to "solve" our tweet cache issue (https://www.simplemachines.org/community/index.php?msg=4154992) by using a proxy inside the tweet-cache.php file.
It produces some error every once in a while, but it doesn't seem that critical.
Is there going to an update to address the domain change from twitter.com to x.com?
Possibly to support both domains
Update
4.0.1
+Support x.com links
Quote from: vbgamer45 on August 20, 2023, 02:40:17 PMUpdate
4.0.1
+Support x.com links
I upgraded from 3 to this new one (started prior to the "?" fix). The tweets with "?" (which is now all tweets) still don't register (there is no error message, but the link remains untouched). Is there something I need to do to allow the improved version to convert the links with the "?"? I didn't remove the table entry for any of the upgrades. Would that have caused an issue?
Anyone else seeing double tweets? Everyone time someone on my forum posts now the tweet shows up twice. I tried removing and re-installing to no avail.
I'm also seeing the following under admin -> Error Log when people embed tweets. The log info doesn't show up every time and as far as I can tell it doesn't affect anything visually. Edit - I went into the thread showing these errors and a bunch came up under my name. So these errors aren't showing up based on who made the tweet, but logged in users who are trying to read the page of the thread with the tweet.
Posted an update hopefully helps with the query string tweets
If you are seeing double embeds I would check that the code is not added twice to Sources/Load.php
Just removed the previous version and installed 4.0.2 - so far not seeing the query string logs. As a bonus, it looks like the double embeds got fixed as well. Will report back if anything changes, thanks a ton!
I regularly had these bugs when I uninstalled and re-installed older AutoTweet mods. For some reason it wasn't correctly removing its entries in the source php files which caused redundancies (double entries) after re-installation.
That very well could have been the issue with mine as I did uninstall and reinstall a couple times. I also didn't check off "Remove all data associated with this modification" until the last time when it worked.
Quote from: vbgamer45 on September 01, 2023, 05:34:05 PMPosted an update hopefully helps with the query string tweets
If you are seeing double embeds I would check that the code is not added twice to Sources/Load.php
Removing all data seems to have fixed the "?" issue that I had, but Tweets from the "x.com" domain are still coming back with Tweet error (does not exist)
Can you provide an example?
Quote from: vbgamer45 on September 03, 2023, 04:46:09 PMCan you provide an example?
This tweet
https://x.com/nfl_dovkleiman/status/1698093742865908221?s=46&t=1vcQIN8GqF5J2oLdxEVEJQ
produces this result
(https://i.imgur.com/onH9SRo.png)
Copy this file to your root directory of your forum and see if it helps
I had the same error as
@mightygiants (posted the same URL) and putting in that new tweet-cache.php fixed it for me.
That said I have a similar error attached with the URL below. If I click on the URL I can load the page in Twitter fine. If I remove everything after the ? it just shows the URL with nothing embedded, but no error. Clicking on the link does work though in that case.
4.0.3
!Handle x.com better, api workaround.
Quote from: vbgamer45 on September 03, 2023, 06:33:52 PM4.0.3
!Handle x.com better, api workaround.
Thank you, that fixed it!
Quote from: GantryZ on September 03, 2023, 06:30:34 PMThat said I have a similar error attached with the URL below. If I click on the URL I can load the page in Twitter fine. If I remove everything after the ? it just shows the URL with nothing embedded, but no error. Clicking on the link does work though in that case.
4.0.3 fixed this issue for me as well, thanks again!
@vbgamer45 , the changelog in the 4.0.3 package only mentions changes up to 4.0.1. Is that supposed to be? Would it be also possible to add a version suffix to the download package? Thanks for all your effort!
4.0.3
!Handle x.com better, api workaround.
4.0.2
!Query string handling improvements