Creating barcode images - barcode

I need to send emails out to several thousand customers with a unique barcode present so they can redeem it either instore or online.
We have a list of coupon/barcode codes to use and have a way to dynamically pull these codes into the email so a customer will see a unique code. The problem is I need to somehow generate several thousand barcode images that are created using the unique codes. How can I solve this?
This would be perfect if our email marketing company had this functionality but unfortunately they don't:
http://www.emaildirect.com/blog/2011/11/create-unique-barcodes-with-emaildirect/
Any help would be greatly appreciated.
I have found my answer!
By using the barcode generator www.barcodesinc.com I generated a URL and input this into my email.
Eg: http://www.barcodesinc.com/generator/image.php?code=999999999&style=197&type=C128B&width=200&height=50&xres=1&font=3
I then changed the 999999999 in the URL to my conditional code to change to the specific code for that person and also bring back the barcode image for that code too!

I have found my answer!
By using the barcode generator www.barcodesinc.com I generated a URL and input this into my email.
Eg: http://www.barcodesinc.com/generator/image.php?code=999999999&style=197&type=C128B&width=200&height=50&xres=1&font=3
I then changed the 999999999 in the URL to my conditional code to change to the specific code for that person and also bring back the barcode image for that code too!

<img src="http://qrfree.kaywa.com/?s=8&d=your+text+here" alt="QRCode"/>
OR
http://qrfree.kaywa.com/?s=8&d=your+text+here

I'm no expert on this and haven't touched html but you could serialize each image and follow this example that has some sample code on QR code given a string.
Imports ThoughtWorks.QRCode.Codec
Dim objQRCode As QRCodeEncoder = New QRCodeEncoder()
Dim imgImage As Image
Dim objBitmap As Bitmap
objQRCode.QRCodeEncodeMode = QRCodeEncoder.ENCODE_MODE.BYTE
objQRCode.QRCodeScale = 2
objQRCode.QRCodeVersion = 5
objQRCode.QRCodeErrorCorrect = ThoughtWorks.QRCode.Codec.QRCodeEncoder.ERROR_CORRECTION.L
imgImage = objQRCode.Encode("Test Data")
objBitmap = New Bitmap(imgImage)
objBitmap.Save("C:\QRCode.jpg")

Hi Try getting in touch with http://www.linktagger.com and ask if they can help. They provide Enterprise type services for the city where I live on maps and bus terminals so it might help you.

Here is an working example to generate barcode for the array of barcodes.We can
retrieve thousands of barcodes from csv file using pandas as well.
This example calls API and save the response in image(.png format) obtained as response from API call.
import shutil
import requests
data = [11111111111, 22222222222222222, 33333333333333, 4444444444444]
url = 'https://www.barcodesinc.com/generator_files/' + 'image.php?'
for d in data:
params = {
'code': d,
'style': '197',
'type': 'C128B',
'width': '200',
'height': '50',
'xres': '1',
'font': '3',
}
response = requests.get(url, params, stream=True)
with open('image-%s.png' % d, 'wb') as out_file:
shutil.copyfileobj(response.raw, out_file)
del response

Related

Any ar js multimarkers learning tutorial?

I have been searching for ar.js multimarkers tutorial or anything that explains about it. But all I can find is 2 examples, but no tutorials or explanations.
So far, I understand that it requires to learn the pattern or order of the markers, then it stores it in localStorage. This data is used later to display the image.
What I don't understand, is how this "learner" is implemented. Also, the learning process is only used once by the "creator", right? The output file should be stored and then served later when needed, not created from scratch at each person's phone or computer.
Any help is appreciated.
Since the question is mostly about the learner page, I'll try to break it down as much as i can:
1) You need to have an array of {type, URL} objects.
A sample of creating the default array is shown below (source code):
var markersControlsParameters = [
{
type : 'pattern',
patternUrl : 'examples/marker-training/examples/pattern-files/pattern-hiro.patt',
},
{
type : 'pattern',
patternUrl : 'examples/marker-training/examples/pattern-files/pattern-kanji.patt',
}]
2) You need to feed this to the 'learner' object.
By default the above object is being encoded into the url (source) and then decoded by the learner site. What is important, happens on the site:
for each object in the array, an ArMarkerControls object is created and stored:
// array.forEach(function(markerParams){
var markerRoot = new THREE.Group()
scene.add(markerRoot)
// create markerControls for our markerRoot
var markerControls = new THREEx.ArMarkerControls(arToolkitContext, markerRoot, markerParams)
subMarkersControls.push(markerControls)
The subMarkersControls is used to create the object used to do the learning. At long last:
var multiMarkerLearning = new THREEx.ArMultiMakersLearning(arToolkitContext, subMarkersControls)
The example learner site has multiple utility functions, but as far as i know, the most important here are the ArMultiMakersLearning members which can be used in the following order (or any other):
// this method resets previously collected statistics
multiMarkerLearning.resetStats()
// this member flag enables data collection
multiMarkerLearning.enabled = true
// this member flag stops data collection
multiMarkerLearning.enabled = false
// To obtain the 'learned' data, simply call .toJSON()
var jsonString = multiMarkerLearning.toJSON()
Thats all. If you store the jsonString as
localStorage.setItem('ARjsMultiMarkerFile', jsonString);
then it will be used as the default multimarker file later on. If you want a custom name or more areas - then you'll have to modify the name in the source code.
3) 2.1.4 debugUI
It seems that the debug UI is broken - the UI buttons do exist but are nowhere to be seen. A hot fix would be using the 'markersAreaEnabled' span style for the div
containing the buttons (see this source bit).
It's all in this glitch, you can find it under the phrase 'CHANGES HERE' in the arjs code.

build app which scans barcodes and sends info to google sheet

Total newbie here but I have a question. We are trying to simplify a second hand book sale and want to build an app which allows parents to scan the barcode of books they want to sell then send this barcode, along with their name and email address (plus maybe a few other questions) to a Google Sheet.
A) is it possible to do this.
B) Any pointers to get started?
EDIT: This is for python code
a) Yes, this is very possible
b)
You are going to need a bar-code scanner that can be connected to a computer and will then, somehow, have to enable this to input into python variables.
In terms of adding to google sheets, it is very possible to do this via Googles current API - if this sounds like jumble, there are plenty of guides at there for doing this in various 'easy' ways.
Here is some basic code to help you get started: (Haven't had the time to test it, and apologies if it is not relevant as I do not know how good you are at python.)
import time
class barcode:
def init(self):
self.code = int()
def getBarcode(self):
print("Insert code to get barcode here. Assign barcode to variable: self.barcode")
if self.barcode != None or self.barcode != "":
return self.barcode()
else:
return False
def getDetails(self):
name = input("Enter your full name: ")
email = input("Enter your email address: ")
return [name, email]
def sendInfo(self, barcode, details):
name = details[0]
email = details[1]
barcode = self.barcode
print("ENTER CODE HERE TO SUBMIT TO GOOGLE SHEETS")
def main(self):
while True:
time.sleep(1)
barcode = self.getBarcode()
if barcode != False:
details = self.getDetails()
self.sendInfo(barcode, details)
If you need more help, or are worse at python than I expect, feel free to comment below.
Extra:
- Haven't had the chance to check it out or check its full relevance however this may help you: https://gist.github.com/JoachimL/1629f701fdb38427091710fc0caef67d

Ruby script for posting comments

I have been trying to write a script that may help me to comment from command line.(The sole reason why I want to do this is its vacation time here and I want to kill time).
I often visit and post on this site.So I am starting with this site only.
For example to comment on this post I used the following script
require "uri"
require 'net/http'
def comment()
response = Net::HTTP.post_form(URI.parse("http://www.geeksforgeeks.org/wp-comments-post.php"),{'author'=>"pikachu",'email'=>"saurabh8c#gmail.com",'url'=>"geekinessthecoolway.blogspot.com",'submit'=>"Have Your Say",'comment_post_ID'=>"18215",'comment_parent'=>"0",'akismet_comment_nonce'=>"70e83407c8",'bb2_screener_'=>"1330701851 117.199.148.101",'comment'=>"How can we generalize this for a n-ary tree?"})
return response.body
end
puts comment()
Obviously the values were not hardcoded but for sake of clearity and maintaining the objective of the post i am hardcoding them.
Beside the regular fields that appear on the form,the values for the hidden fields i found out from wireshark when i posted a comment the normal way.I can't figure out what I am missing?May be some js event?
Edit:
As few people suggested using mechanize I switched to python.Now my updated code looks like:
import sys
import mechanize
uri = "http://www.geeksforgeeks.org/"
request = mechanize.Request(mechanize.urljoin(uri, "archives/18215"))
response = mechanize.urlopen(request)
forms = mechanize.ParseResponse(response, backwards_compat=False)
response.close()
form=forms[0]
print form
control = form.find_control("comment")
#control=form.find_control("bb2_screener")
print control.disabled
# ...or readonly
print control.readonly
# readonly and disabled attributes can be assigned to
#control.disabled = False
form.set_all_readonly(False)
form["author"]="Bulbasaur"
form["email"]="ashKetchup#gmail.com"
form["url"]="9gag.com"
form["comment"]="Y u no put a captcha?"
form["submit"]="Have Your Say"
form["comment_post_ID"]="18215"
form["comment_parent"]="0"
form["akismet_comment_nonce"]="d48e588090"
#form["bb2_screener_"]="1330787192 117.199.144.174"
request2 = form.click()
print request2
try:
response2 = mechanize.urlopen(request2)
except mechanize.HTTPError, response2:
pass
# headers
for name, value in response2.info().items():
if name != "date":
print "%s: %s" % (name.title(), value)
print response2.read() # body
response2.close()
Now the server returns me this.On going through the html code of the original page i found out there is one more field bb2_screener that i need to fill if I want to pretend like a browser to the server.But the problem is the field is not written inside the tag so mechanize won't treat it as a field.
Assuming you have all the params correct, you're still missing the session information that the site stores in a cookie. Consider using something like mechanize, that'll deal with the cookies for you. It's also more natural in that you tell it which fields to fill in with which data. If that still doesn't work, you can always use a jackhammer like selenium, but then technically you're using a browser.

Simple question in ClientLogin using python gdata library

I have incorporated ClientLogin into my python application to retrieve contact list of the user , I like to know how to get the name of the user who has logged in.My code to get the names from the contact list of the user is as given below
gd_client = gdata.contacts.service.ContactsService()
gd_client.email = yemail
gd_client.password = ypass
gd_client.source = 'GoogleInc-ContactsPythonSample-1'
gd_client.ProgrammaticLogin()
query = gdata.contacts.service.ContactsQuery()
query.max_results=150
feed = gd_client.GetContactsFeed(query.ToUri())
for i, entry in enumerate(feed.entry):
#print '\n%s %s' % (ctr+i+1, entry.title.text)
na=entry.title.text
names.append(na)
Please help me to know how to get the name of the user who has logged in
Thanks
ganesh
Edit: Turns out this is only for iterating through the AppsService which will not help you. I am using GAE so for me the google.appengine.api users class takes care of all the heavy lifting for me. I will keep looking into this.
You might try the following code:
gd_client = gdata.contacts.service.ContactsService()
gd_client.email = yemail
gd_client.password = ypass
gd_client.source = 'GoogleInc-ContactsPythonSample-1'
gd_client.ProgrammaticLogin()
nick_feed = gd_client.RetrieveAllNicknames()
for nick_entry in nick_feed.entry:
print nick_entry.nickname.name
print nick_entry.login.user_name
This should work across all the gdata services. I am going to test it though and I will let you know how it goes. This information was found at this location.

ruby-aaws Get specific Album

I am trying to get a specific music cd from Amazon using ruby-aaws.
il = ItemSearch.new( 'Music', { 'Artist' => artist_title,
'Title' => album_name } )
rg = ResponseGroup.new( 'Large' )
req = Request.new(AMAZON_KEY_ID, AMAZON_ASSOCIATES_ID, 'de')
resp = req.search( il, rg, 5)
But this fails. It only seems to work when I search for artist or title, not both at the same time. What am I making wrong? If I construct the url by hand, it works prefectly, but I really don't want to parse the xml manually myself.
I've had a bit of a look at the code of ruby-aaws. It looks like you should be able to set $DEBUG to true before calling any of the ruby-aaws methods/classes and see what URLs are being requested. If there are any discrepancies between your handcrafted URL and the one being generated by ruby-aaws, this might give you some clues.
I just tried this use-case with the latest version of ruby-aaws and it works just fine.
I used the following for the ItemSearch (with the same code you posted initially):
il = ItemSearch.new( 'Music', { 'Artist'=>'The Smiths', 'Title'=>'Hatful' })
and got good results back as I would expect. Please try again and see if perhaps the latest ruby-aaws has ironed out a wrinkle which was stopping you.

Resources