twitter comments

53 views
Skip to first unread message

dorian...@gmail.com

unread,
Feb 18, 2017, 12:11:55 PM2/18/17
to TiddlyWiki
Hello,

I would like to use Twitter for commenting on individual tiddlers. The idea is that each tiddler has a Tweet button that's pre-populated with hashtags of the wiki name and the tiddler's name, and then uses Twitter's embedded search to show tweets tagged with that tiddler, preferably hiding it if there aren't any.

This is what I have right now. Obviously, it would be better for this to dynamically get the wiki name and URL, but I don't know how to do that.

\define post_comment(name) 
<a href="https://twitter.com/share" class="twitter-share-button" data-url="http://nomadical.tiddlyspot.com/#$name$" data-hashtags="$name$, nomadicaltw"  data-dnt="true" data-show-count="false">comment w twitter</a><script async src="//platform.twitter.com/widgets.js" charset="utf-8"></script>
\end

\define view_comments(name)         
<a class="twitter-timeline" data-dnt="true" href="https://twitter.com/search?q=%23nomadicaltw%20%23$name$" data-widget-id="832444815946182657">comments</a><script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+"://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
\end
          

<$macrocall $name="post_comment" name=<<currentTiddler>>/>
<$macrocall $name="view_comments" name=<<currentTiddler>>/>

However, this doesn't work, because embedded JS is disallowed. It seems like I should make a plugin for this, but doing so is dizzying complicated for a newbie. (Indeed, a lot of the technical choices become immensely frustrating as soon as you go a little bit past the use-case). For a while, I was hoping to use a previous version of TiddlyWiki where embedded javascript seems to be allowed, but then the saving functions don't seem to work with TiddlySpot...
 
Could anyone help me with this?

Jed Carty

unread,
Feb 18, 2017, 12:47:12 PM2/18/17
to TiddlyWiki

Josiah

unread,
Feb 18, 2017, 2:06:56 PM2/18/17
to TiddlyWiki
Jed's thing is good. But also this Presenting Tweet

dorian...@gmail.com

unread,
Feb 18, 2017, 3:10:57 PM2/18/17
to TiddlyWiki
Perfect! Is there any way to use Twitter's factory functions? Otherwise, you just end up with the same timeline on each Tiddler, instead of different ones.
Also, is there any way to change the text of "Tweet" button?
Reply all
Reply to author
Forward
0 new messages