Storing various data in a QR code - qr-code

I want to put a web link, emailto link and some text into a QR code. The emailto field should also contain the subject and some body text. Example QR content (the link and mailto link should be clickable):
Some text
www.google.com
mailto:random#gmail.com?subject=SUBJECT_FIELD&body=BODY_TEXT
I tried creating a QR code as text. It didn't correctly interpret the mailto link. It does recognize the To: field, but not the subject and body parameter (probably because of the wrong interpretation of the ? and & signs). I know I could overcome this problem by shortening the mailto link with a url shortener, but I would like to avoid that.
I've also tried using the NTT DoCoMo MATMSG format, a multi URL QR code, a VCard, but nothing worked.
Does anybody know if this is even possible and how I could solve this?

Here's a QR code which uses Subject & Body - it seems to work perfectly with ZXing on Android.
However, QR codes generally only contain one piece of information. An email or a URL or some text. Trying to put different pieces of content into a QR code will lead to unpredictable behaviour.

Related

How to incorporate Html in client script code?

I was trying to send email using send button. Inside the save button I have added some code to declare : to, subject and email body. I want to make the email body a bit nice, by adding some html like h1/h5, p. etc
I have tried to added the html tags like h1/h2 etc or p.. but those part also pops up in the email.
"<html><body><h1>Description:</h1></body></html>\n\t\t" + widgets.Objective.value
The reason that is probably happening is because when you are sending the email, you are not doing it correctly. The code you have provided is not really helpful, so I'm only guessing that your logic to send the email on the server side is not the way it should be. Take as a reference the following code snippet:
MailApp.sendEmail({
to: "recipient#example.com",
subject: "Test Email",
htmlBody: "<html><body><h1>Description:</h1></body></html>\n\t\t"
});
Reference: https://developers.google.com/apps-script/reference/mail/mail-app#sendEmail(Object)
P.S. If this answer is not helpful, please considering editing your question and please include your server side code as well since the current way your question is being asked leaves too much questions flying around.

Facebook's URL Linter & The Open Graph Protocol

I see many pages out there without OG tags (i.e. tags as specified here: http://ogp.me/), yet the Facebook URL Linter seems to be able to get an image and description for them.
For example - you won't see any OG tags (or even other relevant meta tags that could be used to infer said data) on the home page of:
http://www.magicka2.com
But when you take it through Facebook, it finds a description and image:
https://developers.facebook.com/tools/debug/og/object?q=http%3A%2F%2Fwww.magicka2.com%2F
So, what am I missing? The image and description they get seem very specific (and correct). Thanks :)
In case of missing Open-Graph tags, Facebook analyses the page and extracts the image for which it thinks it suits the best and what text should be the description text. They follow some "rules" to determine which picture, but there is also some AI involved and it's part of their systems.
If you want to control which image/title/description your page will show when shared, I would advise to always provide OG-details explicitly.

Formatting text displayed when QR code is scanned

Is there any way I can format the text displayed by scanning a QR code? I know how to make a QR code, and how to format the QR code itself so it can be different colours.
What I want to know is:
If the QR code decodes to the phrase "Hello World", is there any way I can make this phrase appear in blue/bold/15pt font?
Imagine the QR code decodes to "Here is a link for Google:" www.google.com. Here "www.google.com" is a working link. Is there a way I can hide the url (www.google.com) and instead display different text that links to www.google.com? Ex. Here is a link for Google: Click Here.
This will be very helpful for long urls.
No.
You can have plain ASCII or UTF-8 text. That's all the specification will allow.
You can use control character like %0A to create a newline. But that really is about the extent of it.
If you want colour, formatting, HTML links, etc - you're best off pointing the user directly to a web page.
Your second point is rather possible, which means most of the time it will work but it can also make the QR Code unusable (with some readers).
You can use this format: MEBKM. It is made for substituting a URL with a title.
But you'd better make your QR Code data as short as possible and use a mobile website instead as suggested.

Generate a QR code with contact details & URL.Perform both operation to Open Url in web browser & add contact details by using any QR code app

I want to generate a QR code that contains URL & Contact detail both. But real problem is that i want to perform both operation to add contact details in our contact list & open a URL link in web browser with any of QR code reader app. Is it possible with any other way.
Please suggest any solution.
Thanks in advance
you can think of qr codes like text files. only the programm which parses the file decides what to do.
maybe some scanners will recognise the URL and VCard seperate but you can't really count on it.

Parsing PlainText Emails from HTML Content (ASP.NET)

Right, in short we basically already have a system in place where the HTML content for emails is generated. It's not perfect, but it works.
From this, we need to be able to derive a plaintext alternative for the email. I was thinking of instantly jumping on and creating a RegEx to strip the <*> tags from the message - but then I realised this would be no good because we do need some of the formatting information (paragraphs, line breaks, images etc).
NOTE: I am OK with actually sending the mail and setting up alternative views etc, this is only about getting plaintext from HTML.
So, I am pondering some ideas. Will post one as an answer to see what you guys think, but thought I would open it up to the floor. :)
If you need any more clarification then please shout.
Many thanks,
Rob
My Solution
OK, so here it is! I thought up a solution to my problem and it works like a charm!
Now, here are some of the goals I wanted to set out:
All the content for the emails should remain in the ASPX pages (as the HTML content currently does).
I didn't want the client code to do anything more other than say "SendMail("PageX.aspx")".
I didn't want to write too much code.
I wanted to keep the code as semantically correct as possible (no REALLY crazy-ass hacks!).
The Process
So, this is what I ended up doing:
Go to the master page for the email messages. Create an ASP.NET MultiView Control. This control would have two views - HTML and PlainText.
Within each view, I added content placeholders for the actual content.
I then grabbed all the existing ASPX code (such as header and footer) and stuck it in the HTML View. All of it, DocType and everything. This does cause VS to whinge a little bit. Ignore It.
I then of course added new content to the PlainText view to best replicate the HTML view in a PlainText environment.
I then added some code to the Master Page_Load, checking for the QueryString parameter "type" which could be either "html" or "text". It falls over to "text" if none present. Dependant on the value, it switches the view.
I then go to the content pages and add new placeholders for the PlainText equivalents and add text as required.
To make my life easier, I then overloaded my SendMail method to get the response for the required page, passing "type=html" and "type=text" and creating AlternateView's as appropriate.
In Summary
So, in short:
The Views seperate the actual "views" of the content (HTML and Text).
A master page auto switches the view based on a QueryString.
Content pages are responsible for how their views look.
Job done!
If any of this is unclear then please shout. I would like to create blog post on this at some point in more detail.
My Idea
Create a page based on the HTML content and traverse the control tree. You can then pick the text from the controls and handle different controls as required (e.g. use ALT text for images, "_____" for HR etc).
You could ensure the HTML mail is in XHTML format so you can parse it easily using the standard XML tools, then create your own DOM serialiser that outputs plain text. It'd still be a lot of work to cover general XHTML, but for a limited subset you plan to use in e-mail it could work.
Alternatively, if you don't mind shelling out to another program, you could just use the -dump switch to the lynx web browser.

Resources