Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8527373
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T08:32:22+00:00 2026-06-11T08:32:22+00:00

I would like to use QR-codes to streamline the browsing of certain forums with

  • 0

I would like to use QR-codes to streamline the browsing of certain forums with my android smartphone.

I’m looking for a Greasemonkey script that places a QR code next to every permalink, of every post, on a forum thread.

I’ve got a bit of a template to work from, the YouTube ‘share’ QR script:

var shareBoxCheckInterval   = setInterval (AddQR_Code, 200);

function AddQR_Code () {
var shareDiv    = document.querySelector ('.share-option-container .ytg-box');
if (shareDiv) {
    var qrIMG   = 'http://chart.googleapis.com/chart?chl=' 
                + window.location.href + '&chld=M%7C0&cht=qr&chs=125x125';
    var img     = document.createElement ('img');
    img.src     = qrIMG;
    img.width   = 125;
    img.height  = 125;
    shareDiv.appendChild (img);
    clearInterval (shareBoxCheckInterval);
    }
}

What this does is it adds a QR code to Youtube’s sharebox, like so:

Qr code sample result

for easy video transfer from PC to phone.

How do I adapt this code to work with forum permalinks, and replace the link’s text with a QR code image?

For example, on this thread on the Minecraft forum, there is a small link to the top right of every post saying ‘#1′,’#2′,’#3’, ad infinitum — which links to that particular post.

What the userscript would do, is replace the text saying ‘#1’ with a QR code image (generated by the Google API) linking to that post, while also being a clickable hyperlink image (also linking to that post).

It would then repeat this for every permalink on the page.

Would this be possible, and if so, how?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T08:32:24+00:00Added an answer on June 11, 2026 at 8:32 am

    Okay, here’s a complete script that loops through the post bookmarks and adds QR codes.

    I left the post-numbers in because they are useful to me on the forums I use. If you really want them gone, add $(this).text (" "); just before the $(this).append (... line.

    Note the use of CSS for styling (good), not tag attributes (evil).

    The script is slightly complicated with needing the withPages_jQuery structure to make it compatible with Google Chrome (as indicated by the userscripts tag).

    // ==UserScript==
    // @name        _Minecraft Forum, post barcodizer
    // @namespace   _pc
    // @include     http://www.minecraftforum.net/topic/*
    // @grant       GM_addStyle
    // ==/UserScript==
    
    function GM_scriptMain ($) {
        var postBkMarks = $("div.post_block div.post_wrap h3 span.post_id a");
        postBkMarks.each ( function () {
            var qrIMG   = 'http://chart.googleapis.com/chart?chl='
                        + encodeURIComponent (this.href)
                        + '&chld=M%7C0&cht=qr&chs=125x125'
                        ;
            $(this).append ('<img src="' + qrIMG + '">');
        } );
    }
    
    withPages_jQuery (GM_scriptMain);
    
    GM_addStyle (
        "h3 span.post_id a img {width: 125px; height: 125px;}"
    );
    
    function withPages_jQuery (NAMED_FunctionToRun) {
        //--- Use named functions for clarity and debugging...
        var funcText        = NAMED_FunctionToRun.toString ();
        var funcName        = funcText.replace (/^function\s+(\w+)\s*\((.|\n|\r)+$/, "$1");
        var script          = document.createElement ("script");
        script.textContent  = funcText + "\n\n";
        script.textContent += 'jQuery(document).ready(function() {'+funcName+'(jQuery);});';
        document.body.appendChild (script);
    };
    

    (Works in FF/GM, Chrome, Tampermonkey, and other browsers).



    The Firefox (Greasemonkey) – only version (and probably Tampermonkey) is simpler:

    // ==UserScript==
    // @name        _Minecraft Forum, post barcodizer
    // @namespace   _pc
    // @include     http://www.minecraftforum.net/topic/*
    // @require     http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js
    // @grant       GM_addStyle
    // ==/UserScript==
    
    var postBkMarks = $("div.post_block div.post_wrap h3 span.post_id a");
    postBkMarks.each ( function () {
        var qrIMG   = 'http://chart.googleapis.com/chart?chl='
                    + encodeURIComponent (this.href)
                    + '&chld=M%7C0&cht=qr&chs=125x125'
                    ;
        $(this).append ('<img src="' + qrIMG + '">');
    } );
    
    GM_addStyle (
        "h3 span.post_id a img {width: 125px; height: 125px;}"
    );
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to use GDB to step though the C++ code that makes
I´m trying to use spring android to parse an xml that looks like that
Now I have some C source codes, I would like to use it in
I would like to use some code written in python (it uses built in
I would like to use the same code for copying files to an FTP
I am writing boot code where I would like to use only relative addressing
I'm using the following code successfully with HTTP but I would like to use
I would like to know what code to use to convert a double[] array
I would like to know if it is safe to use the following code
I just would like to know what format and codec would use the least

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.