Wikidata:Tools/AutoIdentifierInput

From Wikidata
Jump to navigation Jump to search

AutoIdentifierInput (source) is a User-script which makes it possible to paste the URL of external services into a text field and automatically having the external identifier being added.

In the time of writing it does by default only work with a small set of properties, however, you can configure your own in your common.js file. Note that you can also define multiply URL prefixes for a property in case you for example want to be able to post links from both youtube.com and various Invidious instances.

Usage

[edit]
var AutoIdentifierInputUserProperties = [
	['YouTube', 'https://www.youtube.com/channel/', 'P2397'],
	['LinkedIn', 'https://www.linkedin.com/company/', 'P4264'],
	['Facebook', 'https://www.facebook.com/', 'P2013'],
	['Twitter', 'https://twitter.com/', 'P2002'],
	['Instagram', 'https://www.instagram.com/', 'P2003'],
	['Github', 'https://github.com/', 'P2037'],
	['Vimeo', 'https://vimeo.com/', 'P4015']
];

mw.loader.load( '//www.wikidata.org/w/index.php?title=User:Abbe98/AutoIdentifierInput.js&action=raw&ctype=text/javascript' );