The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 1,862 other subscribers

Archive for the ‘JavaScript/ECMAScript’ Category

Workaround for “embedding” external scripts in JavaScript bookmarklets (thanks @ben_alman).

Posted by jpluimers on 2025/03/25

Bookmarklets are basically URLs that execute a JavaScript function.

Sometimes you want to rely on external JavaScript files (for instance jQuery), but Bookmarklets themselves cannot do that.

Bookmarklets can modify the current page though, and use those to load a script, wait until it is loaded, then continue executing.

Often that is OK as you want to operate the Bookmarklet on that page anyway, but be careful though that you do not mess up the page by loading an incompatible script: test, test, test!

Read the rest of this entry »

Posted in Bookmarklet, Development, JavaScript/ECMAScript, jQuery, Power User, Scripting, Software Development, Web Browsers | Leave a Comment »

Need to write bookmarklet for converting RSS feed URL to PlayerFM import feed URL

Posted by jpluimers on 2025/03/11

Target format:

https://player.fm/importer/feed?url=%s

Where %s is the RSS feed for a podcast as URL encoding.

Example:

https://whycast.podcast.audio/@whycast/feed.xml

becomes

https://player.fm/importer/feed?url=https%3A%2F%2Fwhycast.podcast.audio%2F%40whycast%2Ffeed.xml

Read the rest of this entry »

Posted in Bookmarklet, Development, JavaScript/ECMAScript, Power User, Scripting, Software Development, Web Browsers, Web Development | Leave a Comment »

Weather info in plain text or JSON

Posted by jpluimers on 2025/03/06

Two sites that can help you out getting weather info on the console:

wttr.in

wttr.in is developed by [Wayback/Archive] Igor Chubin (@igor_chubin) / X and looks at the request header to figure out what kind of output it sends.

It supports various output formats, so on my TODO list is to see how they do their mapping: always an opportunity to learn (it’s based on Python and Go so I am curious what libraries they use as well).

From the documentation:

wttr.in currently supports five output formats:

  • ANSI for the terminal;
  • Plain-text for the terminal and scripts;
  • HTML for the browser;
  • PNG for the graphical viewers;
  • JSON for scripts and APIs;
  • Prometheus metrics for scripts and APIs.

The ANSI and HTML formats are selected based on the User-Agent string.

There are more parameters in the documentation on the main page of the repository and through this command:

curl wttr.in/:help

The idea is derived from [Wayback/Archive] GitHub – schachmat/wego: weather app for the terminal.

Oh: Igor has more repositories at [Wayback/Archive] chubin (Igor Chubin) · GitHub (including [Wayback/Archive] GitHub – chubin/cheat.sh: the only cheat sheet you need which is hosted at [Wayback/Archive] cheat.sh; I thought I had blogged about that before, but found it only in a draft note mentioning that I got it via [WaybackSave/Archive] Nicolas Krassas on X: “The only cheat sheet you need cheat.sh)

7timer

A 7 timer JSON usage example is at [Wayback/Archive] Get Weather from 7Timer! · GitHub

It has documentation at

Output formats can be chosen from HTML, PNG, XML and JSON.

Via

[Wayback/Archive] Hacker Public Radio – hpr4266 :: What’s the weather?
Lee writes a script to check what the weather is like ~ The Technology Community Podcast

HPR is a great podcast series!

--jeroen

Posted in *nix, *nix-tools, ash/dash, bash, bash, Development, Go (golang), JavaScript/ECMAScript, JSON, Power User, Python, Scripting, Software Development, Web Development, XML/XSD | Leave a Comment »

Twitter image size suffixes reloaded: pbs.twimg.com URL information

Posted by jpluimers on 2025/02/18

It’s almost

Goal of the current post amend the above posts with information so I can later write a bookmarklet or web-page with JavaScript that – from a x.com or twitter.com – tweet URL can get the JSON, then the images and/or videos in all sizes, then generate a web-page from it for Wayback Machine archival.

Read the rest of this entry »

Posted in Development, HTML, JavaScript/ECMAScript, Scripting, SocialMedia, Software Development, Twitter, Web Development | Tagged: , , , , | Leave a Comment »

evilsocket/jscythe: Abuse the node.js inspector mechanism in order to force any node.js/electron/v8 based process to execute arbitrary javascript code.

Posted by jpluimers on 2025/02/13

This is based on SIGUSR1, so means you need to run as the same user on the same local system, but it can be used for interesting techniques like extending node.js/electron based applications beyond what they were designed for.

[Wayback/Archive] evilsocket/jscythe: Abuse the node.js inspector mechanism in order to force any node.js/electron/v8 based process to execute arbitrary javascript code.

The behaviour has been documented and was known for a long time: [Wayback/Archive] sigusr1 node.js – Twitter Search.

It got my attention because of [Wayback/Archive] Simone Margaritelli on Twitter: “You can force any v8/Electron process to execute arbitrary js code (child_process, http, etc) by forcefully enabling and abusing the builtin debug mechanism … here’s VS Code executing Calc, but I suspect any Electron app is susceptible 🔥 it works with SIP enabled on macOS”

Read the rest of this entry »

Posted in Development, JavaScript/ECMAScript, Scripting, Software Development | Tagged: | Leave a Comment »

A Couple of Quick Bookmarklets For Viewing a Suspended / Deleted Twitter User – ResearchBuzz

Posted by jpluimers on 2025/02/04

For my link archive (I forgot where I found this): [Wayback/Archive] A Couple of Quick Bookmarklets For Viewing a Suspended / Deleted Twitter User – ResearchBuzz

Same for [Wayback/Archive] Bookmarklet for who can see your twitter @reply tweet – By @mhawksey and [Wayback/Archive] Ben Alman » Run jQuery Code Bookmarklet » Generate.

–jeroen

Posted in Bookmarklet, Development, JavaScript/ECMAScript, Power User, Scripting, Software Development, Web Browsers, Web Development | Leave a Comment »

javascript – Open a URL in a new tab (and not a new window) – Stack Overflow

Posted by jpluimers on 2025/01/28

TL;DR: you can force opening a new Window over a new Tab, but not the other way around.

Background information: [Wayback/Archive] javascript – Open a URL in a new tab (and not a new window) – Stack Overflow.

Read the rest of this entry »

Posted in Chrome, Development, Firefox, JavaScript/ECMAScript, Opera, Power User, Safari, Scripting, Software Development, Web Browsers, Web Development | Leave a Comment »

Any YouTube ID is a YouTube ID which means you can use any shorts ID and music ID to watch as a YouTube URL (adding functionality shorts and music URLs lack)

Posted by jpluimers on 2025/01/24

YouTube has diversified its content separating out YouTube Shorts and YouTube Music.

The main YouTube viewing experience has a few advantages over the other two experiences:

  1. content can be monetised
  2. content can arranged into lists (including Watch Later)
  3. auto-play can be turned off

All below links have the same ID, but the ones with checkmarks can use all the above features whereas the ones with crosses cannot.

Read the rest of this entry »

Posted in Development, Google, JavaScript/ECMAScript, Power User, Scripting, Software Development, Web Development, YouTube, YouTubeMusic | Leave a Comment »

XKCD to ExplainXKCD Bookmarklet

Posted by jpluimers on 2025/01/21

Sometimes the XKCD episodes are hard to get, so I wanted a Bookmarklet to navigate to [Wayback/Archive] explain xkcd.

Here is the regular expression to change the domain name part if it matches: [Wayback/Archive] regex101: build, test, and debug regex: VI34VW with this generated sed code:

Read the rest of this entry »

Posted in *nix, *nix-tools, Bookmarklet, Development, JavaScript/ECMAScript, Power User, Scripting, sed, Software Development, Web Browsers, Web Development | Leave a Comment »

A truckload of links which I need for some Bookmarklets work

Posted by jpluimers on 2024/12/31

A while ago, browser tabs were overflowing again so I first mad the list of links with quotes below, then discovered there is a template for many browser tabs open at [Wayback/Archive] To many browser tabs open Meme Generator – Imgflip

One of the reasons is that the WordPress “Press This” bookmarklet is very slow and also flaky at escaping HTML (for instance the below html – Why shouldn’t &amp;apos; be used to escape single quotes? – Stack Overflow sometimes becomes html – Why shouldn’t <code>'</code> be used to escape single quotes? – Stack Overflow in [Wayback/Archive] Press This – WordPress plugin | WordPress.org especially when running it from Archive Today archived pages).

So here we go: Read the rest of this entry »

Posted in Bookmarklet, Development, HTML, HTML5, JavaScript/ECMAScript, Power User, Scripting, Software Development, Web Browsers, Web Development | Leave a Comment »