Retrieving external url title

116 views
Skip to first unread message

Tony K

unread,
Apr 25, 2020, 2:34:43 AM4/25/20
to TiddlyWiki
Is there a way to get a info from an external url into a variable?

Eg putting google.com in a text box and getting back Google in a variable?

Thanks

TonyM

unread,
Apr 25, 2020, 3:23:06 AM4/25/20
to TiddlyWiki
Tony,

  • In this case where does the returned text "Google" supposed to come from?
  • Would you like the value in the browser tabs title or something?
  • Why do you want it?, because perhaps we can get it another way


Regards
Tony

TonyM

unread,
Apr 25, 2020, 3:29:12 AM4/25/20
to TiddlyWiki
Tony K,

A Little research says you can use this such as in the browser developer tools console.

javascript:alert(document.title);

So Either a bookmarklet or perhaps even a macro can be written to retrieve it

Keep in mind it returns the value on the current browser tab/window, or the url so in tiddlywiki it will return the tiddlywikis title.

Regards
Tony M

Mat

unread,
Apr 25, 2020, 3:38:40 AM4/25/20
to TiddlyWiki
As TonyM indicates, yes, if you provide what the information that "google.com" should be associated with "Google". This association could for example be made in a dictionary tiddler.

Another approach would be to mechanically extract the string segment of an url that appears between www. and the succeeding forward slash, etc. E.g from https://www.google.com/foo... you'd extract "google" (..and then perhaps convert it into "Google"). That's doable and not overly complicated.

<:-)

Tony K

unread,
Apr 25, 2020, 4:09:30 AM4/25/20
to TiddlyWiki

Hello Tony and thanks a lot for your help


In this case where does the returned text "Google" supposed to come from?

Google is the title of the web page

Would you like the value in the browser tabs title or something?

Yes

Why do you want it?, because perhaps we can get it another way

To create bookmarks. Paste the url and let the script handle the title

Anne-Laure Le Cunff

unread,
Apr 25, 2020, 4:21:00 AM4/25/20
to TiddlyWiki
Yes, that's exactly how this bookmarklet Chris create works, specifically the document.title part :)

Add it to your toolbar to see it in action. It may even be the whole script you need!

Tony K

unread,
Apr 25, 2020, 4:25:20 AM4/25/20
to TiddlyWiki
Thanks Anne for the reply

Problem with booklets is they operate in the browser. What I mean is how to use them if you are on mobile?

That's why I was looking at something that is TW5 side so a simple copy paste would be enough

Anne-Laure Le Cunff

unread,
Apr 25, 2020, 4:56:46 AM4/25/20
to TiddlyWiki
Oh, gotcha! I don't know about a solution that works on mobile. I'll be following this thread out of curiosity.

Tony K

unread,
Apr 25, 2020, 5:44:46 PM4/25/20
to TiddlyWiki
Done 

here is my first plug-in ever

it is working 100% but, for some reasons, some webpages refuse to work i can't get my head around it yet


hope it will help someone 

Mohammad

unread,
Apr 26, 2020, 12:07:29 AM4/26/20
to TiddlyWiki
Hi Tony K
Would you please add a little text explaining how the plugin work?
has no instruction.

--Mohammad

Tony K

unread,
Apr 26, 2020, 1:16:44 AM4/26/20
to TiddlyWiki
Hello Mohamed

Sorry I'm new to all this 😁 and I didn't think anyone would be interested 😂

Yes sure I'll do it

All the best

Mohammad

unread,
Apr 26, 2020, 3:43:48 AM4/26/20
to TiddlyWiki
Hi Tony K.
 Your plugin can be very useful!

There are some attempt to use bookmarklet to save a webpage (title and link) as a nice TW link as noted in earlier post

Also a great job by called Tiddlyclip which I think needs renovation and polishing UI

I see you are good at JS, perhaps you can use the above idea and your talent and create a useful tools for clipping bookmarking webpages!

--Mohammad

Tony K

unread,
Apr 26, 2020, 4:23:44 AM4/26/20
to tiddl...@googlegroups.com
Hello Mohammad


totally open for any suggestions 
Reply all
Reply to author
Forward
0 new messages