Skip to content

Instantly share code, notes, and snippets.

@cpilsworth
Last active September 11, 2015 13:49
Show Gist options
  • Save cpilsworth/59a58b6db94beecbfc17 to your computer and use it in GitHub Desktop.
Save cpilsworth/59a58b6db94beecbfc17 to your computer and use it in GitHub Desktop.
Simple node app to advertise a URL over BT4 using eddystone protocol

#Eddystone Beacon URL Advertiser

This app takes a url to advertise as a parameter

npm install
npm start http://google.com

This will cause a device with (Bluetooth 4, MBA 2011+, MBP 2012+) to act as an eddystone beacon

References

Proximity API

NPM library for creating an eddystone beacon

Specification for eddystone-url

Chrome iOS Install Chrome for iOS Install widget on notifications panel

{
"name": "advertise-eddystone-url",
"version": "1.0.0",
"description": "",
"main": "server.js",
"scripts": {},
"author": "",
"license": "ISC",
"dependencies": {
"eddystone-beacon": "^1.0.2"
}
}
var eddystoneBeacon = require('eddystone-beacon');
var paramUrl = process.argv[2];
var url = paramUrl || 'http://storm.surge.sh';
eddystoneBeacon.advertiseUrl(url);
console.log('Advertising url: ' + url);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment