[TW5] Comments on a tiddlywiki blogthing

491 views
Skip to first unread message

Jed Carty

unread,
May 17, 2015, 3:23:51 PM5/17/15
to tiddl...@googlegroups.com
After a false start, I was able to get hashover to work with tiddlywiki over on my site. Hashover is a free open source self-hosted commenting system that uses PHP and javascript. There are some very brief and probably not very helpful instructions for setting it up here, I will hopefully make them better at some point.

Mat

unread,
May 17, 2015, 4:05:24 PM5/17/15
to tiddl...@googlegroups.com
Interesting stuff.

Where, actually, are the comments stored? And in what format? I couldn't find info on this on their site.
EDIT: "HashOver is self-hosted, as users post comments, individual XML files are created in a subdirectory named after the page URL under a specified directory in the hashover/scripts/settings.php file."

They state "Restricted use of HTML tags"... could you paste in static tiddlers? (..you may have some thoughts on the recent github thread regarding what we need for static tiddlers)

And, could the posts be individually wrapped into tiddlers?

<:-)

Mat

unread,
May 17, 2015, 4:14:56 PM5/17/15
to tiddl...@googlegroups.com
Hijacker here, commenting on his own answers:
 
Where, actually, are the comments stored? And in what format? I couldn't find info on this on their site.
EDIT: "HashOver is self-hosted, as users post comments, individual XML files are created in a subdirectory named after the page URL under a specified directory in the hashover/scripts/settings.php file."


XML - isn't this something TW can read? Does this mean it could actually be imported into TW?

One thing that I'm guess might work is this, but set for xml:

 <object data="text.txt" type="text/plain">
  Text file not used.
 </object> 

<:-)

Jed Carty

unread,
May 17, 2015, 10:35:05 PM5/17/15
to tiddl...@googlegroups.com
Hashover consists of some php scripts and related files stored on the same server as the tiddlywiki html file, because of this it isn't something that could be used on tiddlyspot. It also isn't a replacement for federation, which if I understand it correctly will allow things that work more closely with tiddlywiki itself. Perhaps a commenting system like this in conjunction with federation would be useful because then people without wikis could still interact.

This is the fist of the possibilities that I have tried out, I just got lucky and it was pretty easy to implement in a tiddlywiki. There may be better alternatives. One of the problems with this one is that due to the license it uses I can't bundle anything for the tiddlywiki side of things with the hashover code.

I am hoping to use hashover to take and store the comments to get around tiddlywiki being unable to give people selective write privileges like it would have to do to allow comments directly. While tiddlywiki can probably be set up to read the contents of xml files I think it will be easier than that. Hashover generates the javascript used to display the comments as it is needed, and the part that actually holds the comment information is a json object (or something very similar anyway). So what I want to do is instead of having hashover both take the comments and display them, I would like to have hashover take and store comments and then have it send tiddlywiki the comments in json format. That way I can make a tool to automate putting the comments into tiddlers and display them however I want. This will also allow some more advanced comment moderation, which is sadly lacking in hashover.

Andreas Hahn

unread,
May 17, 2015, 10:52:27 PM5/17/15
to tiddl...@googlegroups.com
Interesting project and it seems to work really well, nice !

From what I have gathered, it does sound conceivable to implement a syncadaptor module for tiddlywiki that interfaces with hashover either directly or through a php proxy script, thereby treating comments including writing and reading operations as normal operations on tiddlers.

/Andreas
--
You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+...@googlegroups.com.
To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at http://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/cb2f9a19-cda4-45a1-a282-bffdd044d180%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Jeremy Ruston

unread,
May 18, 2015, 4:15:06 AM5/18/15
to TiddlyWiki
Hi Jed,

Great stuff, well done. Hashover seems pretty nice,

Best wishes

Jeremy


For more options, visit https://groups.google.com/d/optout.



--
Jeremy Ruston
mailto:jeremy...@gmail.com

Mat

unread,
May 18, 2015, 9:22:22 AM5/18/15
to tiddl...@googlegroups.com
To have outside people comment, without registering or logging into something, is a MAJOR feature I've missed over the years, and a definite bottleneck. 


 have hashover take and store comments and then have it send tiddlywiki the comments in json format. That way I can make a tool to automate putting the comments into tiddlers and display them however I want. 

That would be fantastic!!!

Do you think such a solution would be possible to stored in e.g google drive or dropbox? I realize this goes against the escape-big-brother idea but since it's the only "server solution" many (including me) have...

<:-)

Jed Carty

unread,
May 18, 2015, 3:10:13 PM5/18/15
to tiddl...@googlegroups.com
Mat,

I never touched php before 4 days ago so I am not sure how everything works. I am pretty sure that since php is run on the server dropbox won't let you use it. So, if there is a way to let you have comments on a wiki hosted on dropbox of tiddlyspot what I have won't do it. I am going to see if I can set things up so this could be hosted on a raspberry pi or something similar that can be used as a cheap server. It isn't an ideal solution but it looks like it may be the best I can do. We may be able to set up a service like tiddlyspot that can act as a server for multiple wikis so not everyone would need to have their own server.

Right now I am working on some code that will let you use tiddlywiki to check for new comments that you then import as tiddlers so you can then do whatever you want with them. It will probably take a bit of effort to include the likes and threaded comments but it should be possible. This will allow more control using only tiddlywiki and let you have some sort of comment moderation. The biggest problem is that while I can make it so you only have to push a single button, you do have to push it import any comments, you can't have people whose comments automatically get displayed without you importing the comments and then saving the wiki. I don't think that is a terrible tradeoff for giving you control.

Jed Carty

unread,
May 18, 2015, 7:46:58 PM5/18/15
to tiddl...@googlegroups.com
It is now set up so that hashover is used to take the comment input and on the backend. The comments get imported into tiddlywiki to be displayed however you wish. At the moment there is no longer support for threaded comments or likes on comments. I can probably put that back in but I am not going to worry about it for now. You can see how the comment importing works on the testing site I made. You can see how the comments look now on the same post as before.

Mat

unread,
May 19, 2015, 3:48:08 AM5/19/15
to tiddl...@googlegroups.com
This is all terribly exciting :-)

The "checking", which if I understan you right is only about "checking if the tiddler exists so to not overwrite existing tiddlers, and update the 'number-of-comments' field", makes my Chrome propose I kill the page so I must click on "Wait" quite a few times. 

Clicking on the button to pull the comments and make tiddlers of them works fast though.

You should probably rephrase this "You will know when you can click on the Check Again button when the text to the right of the button appears." because there is already the parenthesis text to the right of the button. Instead maybe saying "You will know.... when the Check Again button becomes 2 dm long"

I tried putting in some [[wikilinks]] in a post which (not surprisingly) didn't work.

<:-)

Jed Carty

unread,
May 19, 2015, 3:31:00 PM5/19/15
to tiddl...@googlegroups.com
Mat,

Checking the box makes the button load (it makes the wikitext render using a reveal widget), which requires some php to run on the server to see what comments exist there, and checks that against the comments that are already in tiddlers. This is what takes so long. There is one '.' added for each post that has new comments on the server that aren't in the wiki yet, or for posts that have never been checked before. This was there for debugging but I have found it useful to see what is going on. It can easily be removed. Then when you click on the button it pulls the information for each new comment off of the server and creates uses it to create a tiddler for that comment. When the list of comments is displayed that just shows new comments and the buttons tag the comments as accepted or rejected.

I am a bit worried because this does come very close to violating the rule about wikitext rendering not having any side effects. It doesn't change anything on the wiki so I don't think that it is a problem, it just sends some http requests to the server and uses that to generate the correct javascript and wikitext. If that is how you describe what is going on, I am still kind of unsure how all of this works.

I am sure that there are plenty of ways to make it faster. When there aren't so many posts to check than it does go much faster. I changed what things say a bit on my non-testing site, you can open the check comments tiddler using the left menu and see it if you want.

Mat

unread,
May 19, 2015, 4:46:14 PM5/19/15
to tiddl...@googlegroups.com
First regarding my earlier comment that

>I tried putting in some [[wikilinks]] in a post which (not surprisingly) didn't work.

This does work now! Fantastic!

...ironically, I saw that it worked on a tab that I then closed and now I can't figure out how/where.

This might have to do with that your new display at the non-testing site doesn't work! - Checking the box... waiting ... getting the button confirmation... and then clicking the button removes the checkmark and you have to start again. But only to fail again.


Checking the box makes the button load (it makes the wikitext render using a reveal widget), which requires some php to run on the server to see what comments exist there, and checks that against the comments that are already in tiddlers. This is what takes so long.

Thanx for the explanation. I'm sure you're working on clever ways to speed this up, but since it is problematic enough to trigger Chromes "Unresponsive" popup, then a quick bit, if it's not already implemented, might be to store the last time (i.e the last date/hour/minute) a check was done and then use this as a cutoff for new checks. Hope this makes sense.


...and finally, unrelated; The tiddler Tutorials contains a faulty link to: http://inmysocks.tiddlywiki.com/ (...or are you in cahoots with Big J?)
 
<:-)

Jed Carty

unread,
May 19, 2015, 4:51:38 PM5/19/15
to tiddl...@googlegroups.com
Unless you put in a new comment there is nothing for it to get. It worked earlier for me and I haven't received any notification of any new posts.

Jed Carty

unread,
May 25, 2015, 3:19:09 AM5/25/15
to tiddl...@googlegroups.com
I updated the instructions to something that is hopefully more useful. They are here.

Måns

unread,
May 25, 2015, 9:28:38 AM5/25/15
to tiddl...@googlegroups.com
Hi Jed

I'm trying to follow your instructions however I get some errors (I've added a couple of comments to your instructions tiddler by adding the tag "My blog" to it):

I changed the url in hashoverComments.js so it points to my own hashover php script (I don't think you mentioned this step in your instructions..) - however I get this error: "Uncaught ReferenceError: give_output is not defined"
 When opening this tiddler: http://xn--mns-ula.dk/kinabog/#Kommentartest which has this macrocall: "<$macrocall $name=hashoverComments postname=<<currentTiddler>> kickback="xn--mns-ula.dk/kinabog/"/>"



Cheers Måns Mårtensson

Jed Carty

unread,
May 25, 2015, 1:21:50 PM5/25/15
to tiddl...@googlegroups.com
Måns,

Thank you for trying! Now I get to see what all of the terrible terrible mistakes I made are. You are the first who has said anything to me about trying it out so you may find all of my mistakes. Sorry about that.

That error is referencing the javascript-mode.php file in the scripts folder of hashover. What the macro should do is get the javascript generated by hashover.php (which includes what is created using javascript-mode.php) and then run the give_output function from the returned javascript. If it can't find it than check to make sure that in javascript-mode.php line 376 (or somewhere close to that) is "function give_output {", if not than I would check the url for hashover.php, if that is correct than I may have given a link to the wrong files. Are you using the first or second version I list?
Reply all
Reply to author
Forward
0 new messages