I really like how it's going so far, but the only thing keeping it from being a seamless integration with Spotify is that I have to manually open the song tiddler every time a new song plays and close the last one.Almost everything is set up. I have an AppleScript that triggers when a new Spotify song plays which can get the info required to find the tiddler associated with the song. All I need now is some way to command that tiddler to open and all others to close.
Thanks,Matt
On Saturday, February 11, 2017 at 4:22:19 AM UTC-5, PMario wrote:Hi Matt,
Can you describe a bit closer, what you try to achieve? ...
opening and closing tiddlers from the command line is not the purpose of the tw node version.
It's mainly used to "compile" file TiddlyWikis and to run the test server.
-m
--
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 https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/fc989cb4-4617-4173-b3e7-e8283481d0e6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
console.log('pleasework starting');
var http = require('http');http.post = require('http-post');
var newTidText = '{' + '"text": "Tiddler text",' + '"title": "WillThisWork",' + '"type": "text/vnd.tiddlywiki"' +'}';
//var newTid = JSON.parse(newTidText);
http.post('http://127.0.0.1:8080/recipes/default/tiddlers/WillThisWork', newTidText, function(res){ res.setEncoding('utf8'); res.on('data', function(chunk) { console.log(chunk); });});
node pleasework.js
pleasework starting
I spent a lot of time messing around and searching the internet to try to learn how to make an http request.
This is the what I've managed to come up with:
var newTid = { text: "Tiddler text", title: "WillThisWork", type: "text/vnd.tiddlywiki"};
http.post('http://127.0.0.1:8080/recipes/default/tiddlers/WillThisWork', JSON.stringify(newTid), function(res){
res.setEncoding('utf8'); res.on('data', function(chunk) { console.log(chunk); });});
--
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 https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/dc5dd29d-a532-476d-a31c-0cfc074a1afe%40googlegroups.com.
var http = require('http');
ttp.get('http://127.0.0.1:8080/recipes/default/tiddlers/testing', function(res) { console.log("Got response: " + res.statusCode); console.log(res.headers);}).on('error', function(e) {console.log("Got error: " + e.message);});
Got response: 200
{ 'content-type': 'application/json',
date: 'Tue, 14 Feb 2017 13:25:39 GMT',
connection: 'close',
'transfer-encoding': 'chunked' }
On 14 Feb 2017, at 13:32, Matt Groth <mgro...@gmail.com> wrote:The http.get request can also be seen in my network manager. Do you know why the http.post might not be working, given that http.get does work?
syncer-server: Dispatching 'save' task: $:/StoryList
FileSystem: Saved file /Users/Matt/TiddlyMusic/tiddlers/$__StoryList.tid
var storyList = "TiddlerIWantToOpen"$tw.wiki.addTiddler({title: "$:/StoryList", text: "", list: storyList},$tw.wiki.getModificationFields());
Well I was going to post some of my updated findings and ask again for help, when all of a sudden I stumbled upon what may be the answer. All I had to do was run this javascript snippet in Chrome:
var storyList = "TiddlerIWantToOpen"$tw.wiki.addTiddler({title: "$:/StoryList", text: "", list: storyList},$tw.wiki.getModificationFields());
This works perfectly. Now I am just looking for a way to automate the running of this snippet. (Does anyone happen to know how one can automate a javascript snippet in Chrome?)
Is there a reason why all of the http stuff was suggested? This seems like a more direct solution.
On Wednesday, February 15, 2017 at 7:11:00 PM UTC-5, Matt Groth wrote:Hi Jeremy,You're right, the regular http.request was the way to go. After I lot of fiddling, I managed to get update tiddlers with normal HTTP requests!When I send a request, I see this terminal output:
syncer-server: Dispatching 'save' task: $:/StoryList
FileSystem: Saved file /Users/Matt/TiddlyMusic/tiddlers/$__StoryList.tidWhile the .tid file is updated instantly, my TiddlyWiki in Chrome does not sync with the server until I interact with it in some way, such as opening or closing a tiddler. Then, I see the above terminal output again and the changes from my HTTP request appear.However, changes to $:/StoryList do not sync at all, so I am still unable to automate the opening and closing of tiddlers. I have my $:/StoryList.tid text file open, and the 'list' property is changed in that file to exactly what I want. Also, the above terminal output occurs. However, when I do anything to my opened TiddlyWiki, whether it involves opening and closing tiddlers or not, the currently opened tiddlers in my browser simply overwrite whatever was in $_StoryList.tid previously.How can I command TiddlyWiki in my browser to load changes to tiddler values, including $_StoryList.tid?Thanks,MattOn Tuesday, February 14, 2017 at 9:43:08 AM UTC-5, Jeremy Ruston wrote:Hi MattOn 14 Feb 2017, at 13:32, Matt Groth <mgro...@gmail.com> wrote:The http.get request can also be seen in my network manager. Do you know why the http.post might not be working, given that http.get does work?I’m not familiar with the http-post library that you’re using; perhaps it’s doing something funky. I’d be inclined to just use the http module unadorned.Best wishesJeremy
--
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 https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/9248c985-8fc3-4da7-b5a4-49961a938cd9%40googlegroups.com.