{"_id":"@bluemango/smart-pixel-core","_rev":"12-f2a2f40959909d4dee7e8c6c824ae171","name":"@bluemango/smart-pixel-core","description":"Smart Pixel === This library is a helper for creating a script that scrapes values of a page.","dist-tags":{"latest":"1.1.5"},"versions":{"1.1.1":{"name":"@bluemango/smart-pixel-core","version":"1.1.1","description":"Smart Pixel === This library is a helper for creating a script that scrapes values of a page","main":"dist/smartPixel.min","scripts":{"test":"grunt test","build":"grunt build"},"author":"","license":"ISC","devDependencies":{"grunt":"^0.4.5","load-grunt-tasks":"^2.0.0","grunt-contrib-concat":"^0.5.0","grunt-contrib-jshint":"^0.12.0","grunt-contrib-uglify":"^0.7.0","jasmine-core":"^2.1.3","grunt-githooks":"^0.3.1"},"gitHead":"17f1f1485e83bf23cb78ecae25fa3c8f0fa07caf","_id":"@bluemango/smart-pixel-core@1.1.1","_shasum":"3a50bbc4f21d6e5fcd1a1c620106e4aa144dbbe8","_from":".","_npmVersion":"3.10.8","_nodeVersion":"6.0.0","_npmUser":{"name":"bluemango","email":"development@bluemango.nl"},"dist":{"shasum":"3a50bbc4f21d6e5fcd1a1c620106e4aa144dbbe8","tarball":"https://registry.npmjs.org/@bluemango/smart-pixel-core/-/smart-pixel-core-1.1.1.tgz","integrity":"sha512-3w5k/qUBL19FDzi0BWQGZEebYypqafuODDOfWs/3xKXahWouEd13VuaCVXHRX63Pte/na5KtjMIPpKEFhWIIgw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDJYHHvuVZzumoAs8U+BuSavWQK2gDQheJy5XFNOzte0AiEAnvGxrkrorhp69QqKyACOq6xsYm7jX1o0fzgXaYZxz+Y="}]},"maintainers":[{"name":"bluemango","email":"development@bluemango.nl"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/smart-pixel-core-1.1.1.tgz_1492506794898_0.8613332910463214"},"directories":{},"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"1.1.2":{"name":"@bluemango/smart-pixel-core","version":"1.1.2","description":"Smart Pixel === This library is a helper for creating a script that scrapes values of a page.","main":"dist/smartPixel.min","scripts":{"test":"grunt test","build":"grunt build"},"author":"","license":"ISC","devDependencies":{"grunt":"^0.4.5","load-grunt-tasks":"^2.0.0","grunt-contrib-concat":"^0.5.0","grunt-contrib-jshint":"^0.12.0","grunt-contrib-uglify":"^0.7.0","jasmine-core":"^2.1.3","grunt-githooks":"^0.3.1"},"gitHead":"40e6a2bcbd17abdd5fb2a62ab4eae5835030bd55","_id":"@bluemango/smart-pixel-core@1.1.2","_shasum":"f7149c85fcf0b1424d7ff69e201b7cc7ef022e1e","_from":".","_npmVersion":"3.10.8","_nodeVersion":"6.0.0","_npmUser":{"name":"bluemango","email":"development@bluemango.nl"},"dist":{"shasum":"f7149c85fcf0b1424d7ff69e201b7cc7ef022e1e","tarball":"https://registry.npmjs.org/@bluemango/smart-pixel-core/-/smart-pixel-core-1.1.2.tgz","integrity":"sha512-WIEXcvh+2c/giACzNHt2CGxZpY+9X3e+xM8cZLfsf/XA5PfSmucLVqLfUxtULOqgj6JGgEQ3sVNfoxnBYgC28A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBYLvyYDcqMXRQ2aWIxg2cx08mmcOGvQ754DK0hWGTpJAiEAvsT8xZwjX2zo52I8M1x2Y06eRyThpPAfjKOdQS1JPSI="}]},"maintainers":[{"name":"bluemango","email":"development@bluemango.nl"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/smart-pixel-core-1.1.2.tgz_1492777729946_0.866775328759104"},"directories":{},"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"1.1.3":{"name":"@bluemango/smart-pixel-core","version":"1.1.3","description":"Smart Pixel === This library is a helper for creating a script that scrapes values of a page.","main":"dist/smartPixel.min","scripts":{"test":"grunt test","build":"grunt build"},"author":"","license":"ISC","devDependencies":{"grunt":"^0.4.5","load-grunt-tasks":"^2.0.0","grunt-contrib-concat":"^0.5.0","grunt-contrib-jshint":"^0.12.0","grunt-contrib-uglify":"^0.7.0","jasmine-core":"^2.1.3","grunt-githooks":"^0.3.1"},"gitHead":"439a040b33e24e271d98be8330e2c6dcd4b9b69f","_id":"@bluemango/smart-pixel-core@1.1.3","_shasum":"727124455a1a645fb1d4d896cc7dee586ae67bd8","_from":".","_npmVersion":"3.10.8","_nodeVersion":"6.0.0","_npmUser":{"name":"bluemango","email":"development@bluemango.nl"},"dist":{"shasum":"727124455a1a645fb1d4d896cc7dee586ae67bd8","tarball":"https://registry.npmjs.org/@bluemango/smart-pixel-core/-/smart-pixel-core-1.1.3.tgz","integrity":"sha512-FEoUj8gvzbhQVdgE+wqSJM6yw8HKdrTHhqZHVSbRMdiLnRtBoxpqN/Zb0DDHka14ZEBh5gOYp1gcggr+rGif6Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCrsQzaPEXNE8OXqF3vjHM3P70SphBUEzhvwxfkkn75egIgWgrJPyg0Zf25LkvqN914ALNoH50CMB2YSJ1nyZ/gkqo="}]},"maintainers":[{"name":"bluemango","email":"development@bluemango.nl"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/smart-pixel-core-1.1.3.tgz_1493710870412_0.3358580912463367"},"directories":{},"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"1.1.4":{"name":"@bluemango/smart-pixel-core","version":"1.1.4","description":"Smart Pixel === This library is a helper for creating a script that scrapes values of a page.","main":"dist/smartPixel.min","scripts":{"test":"grunt test","build":"grunt build"},"author":"","license":"ISC","devDependencies":{"grunt":"^0.4.5","load-grunt-tasks":"^2.0.0","grunt-contrib-concat":"^0.5.0","grunt-contrib-jshint":"^0.12.0","grunt-contrib-uglify":"^0.7.0","jasmine-core":"^2.1.3","grunt-githooks":"^0.3.1"},"gitHead":"0882942b3447ce1551e7c0af4e034e1a3d4610bd","_id":"@bluemango/smart-pixel-core@1.1.4","_shasum":"ca523247ad35788d2b79e569f6614cb582070fec","_from":".","_npmVersion":"3.10.8","_nodeVersion":"6.0.0","_npmUser":{"name":"bluemango","email":"development@bluemango.nl"},"dist":{"shasum":"ca523247ad35788d2b79e569f6614cb582070fec","tarball":"https://registry.npmjs.org/@bluemango/smart-pixel-core/-/smart-pixel-core-1.1.4.tgz","integrity":"sha512-sOc6PphiUvQ0/lryTyoTh8GAv3uFOGMg7GGooTvuuc9IgtwpZSN8eFrbnd3SzyY27ky7jDmCKmS6qyHe79UCvg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD0S9+0qlCKyqCFVbbSEX+lvJsEpQNwfuGtNIEW4nIs/gIgYUclZqba6dZYfmS59LIWSQpU0IO6Wiy79j8JpAJ3jp0="}]},"maintainers":[{"name":"bluemango","email":"development@bluemango.nl"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/smart-pixel-core-1.1.4.tgz_1493796175087_0.442409495357424"},"directories":{},"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"1.1.5":{"name":"@bluemango/smart-pixel-core","version":"1.1.5","description":"Smart Pixel === This library is a helper for creating a script that scrapes values of a page.","main":"dist/smartPixel.min","scripts":{"test":"grunt test","build":"grunt build"},"author":"","license":"ISC","devDependencies":{"grunt":"^0.4.5","load-grunt-tasks":"^2.0.0","grunt-contrib-concat":"^0.5.0","grunt-contrib-jshint":"^0.12.0","grunt-contrib-uglify":"^0.7.0","jasmine-core":"^2.1.3","grunt-githooks":"^0.3.1"},"gitHead":"7875915c8f5f93acda002fe1ff5f0c3f5f32dff3","_id":"@bluemango/smart-pixel-core@1.1.5","_shasum":"ed06492a35d3f7586edacc7a3008783d738fd5ea","_from":".","_npmVersion":"4.2.0","_nodeVersion":"7.9.0","_npmUser":{"name":"bluemango","email":"development@bluemango.nl"},"dist":{"shasum":"ed06492a35d3f7586edacc7a3008783d738fd5ea","tarball":"https://registry.npmjs.org/@bluemango/smart-pixel-core/-/smart-pixel-core-1.1.5.tgz","integrity":"sha512-X7EzVbmaAdZOa3iAsaxANBNZvQmkQUx9SV1SzA7TpROfXlgVOC4eFyU+0Sq66IHWu7fQOngSwxnq5qJkdTeTrw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQChtjQyb+X+klU/wdZNPRuuQ7rw4UYLJXYv4Kf9hPi//wIgDtceEfS9TwczMHUnRJgDFwsLOiJ/WhmacH6qi55rYZs="}]},"maintainers":[{"name":"bluemango","email":"development@bluemango.nl"},{"name":"bramvandersommen","email":"bram.van.der.sommen@greenhousegroup.com"},{"name":"martijnmol","email":"martijn.mol@greenhousegroup.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/smart-pixel-core-1.1.5.tgz_1495433024939_0.500415219925344"},"directories":{},"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."}},"readme":"Smart Pixel\n===\nThis library is a helper for creating a script that scrapes values of a page.\n\n```\nvar smartPixel = new SmartPixel({\n  title: {\n    type:'text',\n    selector:'h1.the-title' // this is a jquery selector that will look for the first h1 with the class the-title\n  }\n})\nreturn smartPixel.getResults() // {title:'hello world'}\n```\n\n##The config\nThe config is an objects where where every key stands for a field that wil be returned in the results. the value of the config item can be a `string`, `object` or a `function`.\n\n###whitelistedDomain \nOnly allow the library to work when the value matches the current domain. Value should be a regular expression of type string.\n\nusing an object\n---\nThere are several types that you can select to configure your Smart Pixel via objects. the types you can choose from are listed below.\n### text\nUse text to extract text from a page.\n\n```\nvar smartPixel = new SmartPixel({\n  title: {\n    type:'text', // default value\n    selector: '.title span',\n    test: '/[0-9]*/g' // this wil test if the result only contains digits\n  }\n})\n```\n\n### url\n\n```\nvar smartPixel = new SmartPixel({\n  clickUrl: {\n    type:'url', // will return the current pageurl\n    prefix: 'htttp://yourredirect.com/url=' (optional) use when you want to prefix your url,\n    query: {myparam:''} // (optional) returns the url with only myparam appended to the url\n  }\n})\n```\n\n### image\n\n```\nvar smartPixel = new SmartPixel({\n  imageUrl: {\n    type:'image', // will return the src of an image\n    selector: 'image#myImage'\n  }\n})\n```\n\n### regex\n\n```\nvar smartPixel = new SmartPixel({\n  title: {\n    type:'regex',\n    selector: '.title span',\n    test: '/€([0-9]*)/g' // wil return the first regex group\n  }\n})\n```\n\n### template\n\n```\nvar smartPixel = new SmartPixel({\n  title: {\n    type:'template',\n    template: 'hello {{name}}' // will return the value of name\n  },\n  name: {\n    type: 'text',\n    selector: '.profile .name'\n  }\n})\n```\n\nusing a string\n---\nJust a short hand for a selector with the type text (see example below).\n\n```\nvar smartPixel1 = new SmartPixel({\n  title: h1.the-title\n})\n\nvar smartPixel2 = new SmartPixel({\n  title: {\n    type:'text',\n    selector:'h1.the-title' // this is a jquery selector that will look for the first h1 with the class the-title\n  }\n})\n```\n\nusing an function\n---\n\n```\nvar smartPixel = new SmartPixel({\n  number1: {type:'template', template:'1'}\n  number2: {type:'template', template:'3'}\n  sum: function(smartPixel){\n    var n1 = Number(smartPixel.getField('number1'))\n    var n2 = Number(smartPixel.getField('number2'))\n    return n1 + n2 // = 4\n  }\n})\n```\nYou can also make a function property required:\n\n```\nvar smartPixel = new SmartPixel({\n  number1: {type:'template', template:'1'}\n  number2: {type:'template', template:'3'}\n  sum: {\n    type: 'function',\n    func: function() {\n        var n1 = Number(smartPixel.getField('number1'))\n        var n2 = Number(smartPixel.getField('number2'))\n        return n1 + n2 // = 4\n    },\n    required: false,\n  }\n})\n```\n\nDefault fields\n---\n\nby default the Smart Pixel only returns the following fields ['id', 'available', 'title', 'imageUrl', 'clickUrl', 'category', 'basket', 'description', 'priceNormal', 'priceDiscount', 'logoUrl', 'stickerText', 'custom1', 'custom2', 'custom3', 'custom4']\n\n## Releasing a new version\n\n###Make a new build\nThe main file for the module is the minified version of the Smart Pixel in `dist/smartPixel.min.js`, so we need to make sure we do a new build we publish the module. Before building, make sure you change the version number in `package.json`. You can't publish a NPM package with a specific version twice.\n\n```\nnpm run build\n```\n\n###Publish new version to NPM \n```\nnpm publish\n```\nAfter publishing a new version of the Smart Pixel core script, please create a new tag in Git. Use the `vX.X.X` format for the tag name.\n\n**Note:** You need to be logged in to NPM (`npm login`) using the *bluemango* account. This is the only account that has the right permissions to publish the Smart Pixel NPM package.","maintainers":[{"name":"bluemango","email":"development@bluemango.nl"}],"time":{"modified":"2022-11-23T15:13:31.642Z","created":"2017-04-18T09:13:15.654Z","1.1.1":"2017-04-18T09:13:15.654Z","1.1.2":"2017-04-21T12:28:51.812Z","1.1.3":"2017-05-02T07:41:11.056Z","1.1.4":"2017-05-03T07:22:55.717Z","1.1.5":"2017-05-22T06:03:46.516Z"},"license":"ISC","readmeFilename":"README.md"}