Oh, thanks! Is it possible to do that without actually allowing Twitter logins?
Disable enable twitter logins and just provide twitter consumer key & twitter consumer secret.
Tried it. It didn’t work. Embedded tweets still do not contain images.
Some long tweets with images don’t work
Shorter tweets with images works
It exists since the new twitter policy regarding links and images in the 140 characters count
I’ve just submitted a PR which should fix this:
@david - thank you! We do a lot of Twitter oneboxing and found the truncation very annoying.
This is terrific - my forum users really need this.
Is this merged into a future release or something we have to do to modify in our existing installations?
Just upgrade on latest version, it should be good :
- via
yourforum.com/admin/upgrade - or SSH into your server and do these commands :
cd /var/discourse
git pull
./launcher rebuild app
I don’t think you need to add the twitter consumer key and twitter consumer secret in your admin settings but I’m only 99% sure
Yep - it’s all merged into master and working great on my forum
I’m afraid you will need to add these keys to your site settings - the data is fetched via the twitter API rather than opengraph/oembed.
It’s always the 1% left 
I just pushed a small improvement for Twitter onebox. The onebox will now show like and retweet count.
@awesomerobot
のシンプルな CSS 修正はありますか?
現時点では、モバイル版では最大高さ(70vh)と幅 100% を設定し、動画が収まるようにスケーリングしています。これは横長の動画よりも縦長の動画に適しています。
ほとんどの動画が横長であると想定できますが、その場合、縦長の動画を切り捨てるというトレードオフが発生します。
アスペクト比がわからない限り、両方に対する簡単な解決策はありません(これらのアスペクト比を計算し、それに基づいてスタイルを付加することは可能でしょうか?iframe には height/width が含まれているようです)。
はい、可能です。iframe を構築しているのはこの行です。
@awesomerobot さんにとって最も役立つ HTML 構造はどのようなものでしょうか?例えば、
<div class='tweet-images'>
<div class='aspect-image-full-size' style='--aspect-ratio:#{width}/#{height};'/>
<iframe class='tweet-video' src='https://twitter.com/i/videos/blah' width='123' height='456' frameborder='0' allowfullscreen></iframe>
</div>
</div>
このようにして、画像で既に使用している aspect-image-full-size のロジックを再利用することはできますか?
うん、それならできそうね。アスペクト比があるから、必要に応じて調整できると思う。
Zapierから取得したツイートをトピックとして、このように表示させる方法を探しているのですが、うまくいきません。どなたか方向性を示していただけませんか?設定で「onebox」を有効にするだけで機能するでしょうか?
埋め込みツイートに返信されている元のツイートを表示させる方法はありますか?例えば、このツイート https://twitter.com/AOC/status/1230329539924025345 を埋め込むと、phpBB や vBulletin ではツイート自体と、彼女が返信している内容の両方が表示されます。
phpBB:
vB:
しかし、Discourse では返信部分のみが表示され、元のツイートの文脈がないと意味が通じないことがよくあります。
もちろん、元のツイートと返信ツイートの両方を投稿するのは簡単ですが、ほとんどのユーザー(そして私たちが利用しているいくつかのTwitterボット)は、それを行う必要があることに気づくほど賢く、あるいは意識的ではありません。
これは非常に厄介な問題です。公式の Twitter 埋め込みコードには 2 つの課題があります。
- 高さが提供されないため、読み込み時にトピックのレイアウトが跳ねてしまいます。
- 全サイトで Twitter の JavaScript ファイルを実行する必要があります。
このため、独自のカスタムレンダラーを使用して回避策を講じましたが、その結果、公式の埋め込みコードの更新に常に追いつく必要が生じています。


