2013-09-08

2013-09-07 YouTube bookmarklet (for chatango)

About bookmarklets

I recently discovered a new level of usefulness of the concept of bookmarklets for myself.

Bookmarklets are bookmarks, that can perform special functions,
often times acting upon the currently loaded page in some way.
Otherwise they are handled very similar as any other normal bookmarks.

Instead of a http or https url, bookmarklets use references of the pseudo type javascript.
So bookmarklets are basically scripts, that are executed when the user clicks on them.

Apart from not starting to run by themselves, bookmarklets offer about the same possibilities
and suffer about the same restrictions, as other client sided scripts running on or by web pages
currently loaded in the browser.

Update 2014-07-26:
I just stumbled upon some resources explaining about bookmarklets:
Firefox support: Use bookmarklets... 
- the German version of that article Bookmarklets verwenden... seems to be even better
- containing a nice animation with useful examples. :-)
Maybe [one of ]those can help you understand about the subject even better, then by my explanations alone.

One of the applicable restrictions is, that javascript is usually not permitted to directly read from or write to the systems clipboard, because of browser security concerns.
(Someone has apparently tried to use it to spread spam by continuously writing it to the clipboard...)

Bookmarklets are tools in the area of influence of users with the capability of modifying
the way a certain loaded web page look or reacts.
They can also be used for mining or recompiling data.

Addressing Chatango YouTube problems

Chatango stands for a system of group chats (or 1:1 chats) that can be easily embedded to other sites.

I found and shared peoples want to share YouTube videos via Chatango group chats.
- And also I found the problems connected to that.
I wrote about those and my suggestions to get along with them in my post:
2012-12-05 How you can and should post YouTube videos to Chatango group chat
and provided some help to more easily acquire simple (or should I say basic) YouTube video urls
in my post: 2013-01-02 Get simple YouTube urls tool.

That tool however required to open some window containing that tool and then copying urls back and forth...

Now that I arrived at the bookmarklet stage, I found and finally realized a solution that can be more conveniently applied.

You can simply have a bookmarklet at a convenient place among your browsers bookmarks and use that on a YouTube page for showing a video.
You can there and then copy a set of compiled basic video data together with a simplified url for showing that video, fit to post in a chatango (group) chat.
Picking up an old example, something like that:
might appear near the upper left corner in your browser window.

As you can see, the text is already selected. So you can simply copy it, using Ctrl+C or the context menu.

The last line will change into an "embedded video" in Chatango (group) chat.
In fact my recent experiences did not contain videos, that could be played inside the chat any more, but at least something showing a preview picture, you can click on, to open the video in another tab.

The line before that is intentionally stripped of some of it's "prefixes", so that it will not cause problems in chatango 1:1 chat while still containing the basic data to reference the video.
This will conserve that reference data in textual form even if the embedded part should no longer show or play.

In the first line there is the channel name and the title of the video,
so you know a little about the video to help you decide if it is worth your click.
("you" meaning someone on the receiving end in that case)
Also those data may help in identifying and recovering lost videos.

If you use that bookmarklet ("SimpleYtVidData") on any other kind of page (not a www.youtube.com watch video page) it will show the mini editor without any containing text.
You can use that for editing, copying and pasting text and it allows you to utilize the browsers spell checker - if present.

Download/installation

As mentioned above, a bookmarklet is basically a bookmark,
meaning something to be added to your browsers bookmarks
- or wherever  you collect your bookmarks, as long as it can also contain,
say at least 2000 or 3000 bytes of javascript code (in this case).

The mentioned solution, carrying the link name "SimpleYtVidData",
is currently posted on my experimental site:
http://marwin99.dyndns.org/feedback.html
http://marwin99.goip.de/#SimpleYtVidData
2013-10-24: There is an improved version.
The mini editor can remember the text you typed on non YouTube video sites
and the ampersand (&) character in video titles will be handled correctly.

Some feedback, f.e. about if/how it also works in your environment would be helpful.

Tip: Using Firefox you can mark such a bookmarklet on the site and see a more readable form
of its source code, using "view selection source" from the context menu.

Update 2013-10-15:
Presumably the site marwin99.dyndns.org will be available till the end of October 2013
and then be unavailable.
If that is the case, you will probably not be able to reach me either.

Update 2014-07-17:
I'm back online again.
My mentioned experimental site moved to marwin99.dnsget.org marwin99.goip.de.
I updated the link above.

I have plans for a more flexible way of  providing various bookmarklets, at the back of my head,
including ways of customization, adaptation/modification
- perhaps you would like another color than orange as shown above -
- it could even be used as a tool to create entirely new bookmarklets of your own.

That might not be realized until a few critically needed resources have arrived though,
including but not necessarily limited to life communication...

(As far as I know, even blogger allows for asking questions...)


No comments:

Post a Comment