Hi all. I need a tool (JavaScript, Keyboard Maestro, etc) that will easily clip the following information from a Discourse post (not Topic) when I either hover over the post, or select some text in the post:
URL of the post
Date of the post
Author of the post
Copy as rich text all of the post to the clipboard
Topic Title
I plan to build this tool if I need to, but I thought I would first ask if anyone knows of such a tool, or anything similar?
I would love to get even JavaScript snippets that provide any part of the data I want.
This tool is for use by any user.
All ideas appreciated.
I have done considerable searching, both here and on the Internet in general, and have been unable to find anything relevant/helpful.
I would start by setting your browser or HTTP request agent to the google web spider agent. Because we present simple 1996 era content to those kinds of webcrawlers to make crawling easier.
I have made good progress in building this tool in JavaScript using Xpaths.
But I need a way to detect if the current web page is powered by Discourse.
I need something I could search for using JavaScript that would identify it as Discourse.
<meta name="generator" content="Discourse 1.7.0.beta4 - https://github.com/discourse/discourse version 25a82e7d22d9eb2567c9b9e738049050e8e7434d">
So, I use this code to check for a “Discourse” web page:
//--- DETERMINE FORUM SOFTWARE ---
var metaGen = document.querySelector('meta[property="generator"]');
var contentStr = metaGen.getAttribute("content");
if (contentsStr.match(/discourse/i)) {
var forumName = "Discourse";
}