0.1.0 • Published 10 years ago

bpt-barcoding v0.1.0

Weekly downloads
2
License
MIT
Repository
-
Last release
10 years ago

Brown Paper Tickets Barcoding

Get barcodes of tickets sold to your events.

This library uses an API endpoint for the old v1 API. Unfortunately, a barcoding endpoint in v2 does not exist. This is currently the only way to obtain barcde data.

Brown Paper Tickets uses Code 128b barcodes. Build Status

Install

Install via npm: npm install bpt-barcoding.

Usage

var barcoding = require('bpt-barcoding');

Parse a CSV downloaded from Brown Paper Tickets.

barcoding.parseBarcodeFile('/path/to/a/csv/file.csv', function(error, barcodes) {
	
	if (error) {
		return error;
	}
	
	console.log(barcodes);

});

This will returns an array of tickets:

[{
	barcode: 'EBEHZY2KDQ',
	ticketID: '25124052',
	priceID: '2217843',
	attendeeName: 'blum chandler',
	sectionName: 'Loge',
	rowName: 'AA',
	seatName: '3',
	scanned: false,
	bulkOrder: false // If the CSV was a bulk ticket order, this is true
}]

Get barcodes via the API.

You'll need to pass in your BPT Username and Password to each of these methods. USE AT YOUR OWN RISK.

	var login = 'your_bpt_username',
	password = 'your_password';

Pass in an array of Date ID's. You can get Date IDs from the supported Datelist API call.

If you don't pass in a dates array, it will return a list of tickets purchased for all active events.

var dates = [12345, 12345, 12345];

barcoding.getTickets(login, password, dates, function(error, tickets) {
	if (error) {
		return error;
	}

	console.log(tickets);
});

This will return an array of tickets for the passed dates:

[{
	barcode: 'MW2MBRZX9Y',
	ticketID: '34331104',
	priceID: '2522667',
	attendeeName: 'Name Unknown',
	sectionName: '',
	rowName: '',
	seatName: '',
	scanned: false,
	bulkOrder: false
}]

Getting a list of dates.

You can get a list of dates using the supported Datelist API call.

You could also use the getDates method to get a list of dates:

barcoding.getDates(login, password, function(error, dates) {
	if (error) {
		return error;
	}

	console.log(dates);
});

This will return an array of date objects:

[{
	dateID: '881908',
    eventName: 'Another Test Event!',
    eventDate: '2017-08-14 13:00:00'
},
{
	dateID: '881916',
    eventName: 'Another Test Event!',
    eventDate: '2018-08-12 19:00:00'
},
{
	dateID: '880781',
    eventName: 'Test Event',
    eventDate: '2016-08-12 07:30:00'
},
{
	dateID: '882531',
    eventName: 'Test Event',
    eventDate: '2016-12-13 14:00:00'
}]

Contributing

Pull requests are welcome.

Changelog

0.1.0 - Initial Release

License

The MIT License (MIT)

Copyright (c) 2014 Brown Paper Tickets

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.