Skip to main content

Posts

A Loyalty Pass Journey

Today's post is going to serve as a bit of a journal, the pitfalls and triumphs I'm facing as I achieve a smooth user experience in the world of creating digital loyalty cards.  The main player I'm working with on this is with Airship (formally Urban Airship).  Their support has been fairly good, I personally had the most trouble in linking the template with Google Pay.  The best piece of advice I can give is, do not start creating the template until you have got the Merchant Centre all ready to go. This is all going rather well at the moment, including using the Adaptive Link APIs which provides a simple query string approach which will redirect the request to either the iOS or Android pass depending on their device.  Ultimately though I would like to eventually call the Google and Apple API's directly so this has been a side project. I'm starting with Google, and the main piece of documentation starts here . Straight away there is a missing, or at least mis...

Scraping Hidden Data

I'm genuinely excited to write this particular entry, for two reasons.  One is that its been some time since I've jumped back in to NodeJS, but the other because is because it is my first attempt at writing something using Puppeteer .  I needed to scrape information about products on a particular website, and through my exploration, on each iteration of the page parameter in the query string, in the Chrome Developer Tools , there was an API request for the granular information that I needed for the products. It was extremely difficult to work out just how this URL was being constructed in order to know what to request for, but I quickly came to a conclusion that if there was information in the developer tools, then that could be somehow extracted - and remembered this little tool existed - so I hopped to work! So the premise came across as being rather simple - intercept the browser making the requests that you find in the network tab .  There was one path that I knew...

Liberating Light Data - Part 2

After much research, I felt it was only fair to share the knowledge, and so picking up from one of my last posts where I demonstrated how to get data, now it's time to dive in to how to write data to Google Sheets.  The rest of the class can stay the same, we're just going to add one function. So what's happening here? The main thing to point out is that we want to pass an array of arrays for the values, representing the rows and columns.  If you are going to be wanting to do that in an API, might not be as simple without serializing and base64 encoding for good measure. Otherwise, it's fairly self-explanetory.  I'd be happy to try and answer any questions, but hope it inspires!

Back in to Dashboard Reports

Carrying on from my last post , a while back, I blogged about how I took data from Campaign Monitor and posted to Google's Data Studio for the sake of creating a better, compiled dashboard.  Well the request popped up again for me, but this time to take some more generic data, so I decided to write a better class for it. This is going to be short and sweet, like the previous post, we're going to need a simple addition to our composer.json: The construct object is going to look very similar as well: And now we'll just make a simple upload function to use to store in Google's storage buckets: From there - you can go nuts in the Data Studio.  Folder and file naming conventions are very important, with spreadsheets for instance, you can keep uploading date stamped files which will merge nicely and you can see your increments over time. Hope you'll all be able to make some cool integrations with this! J.

Liberating Light Data

On to a new topic today, we've all heard the buzz about "Big Data" and how we can tackle querying in lightning fast speeds, but what are some of the best ways of working with highly mutable but tiny data sets? I'll lead you in by example on this one - I had recently had a custom developed PIM (Product Information Management) system, but also part of this system, I also kept a database of our stores and their respective catalogue versions. For a while, it was good - until it wasn't. It didn't scale that effectively in the long term. The PIM should have only been just that, not a hybrid of extraneous bits and pieces of data. So I'm going to fast forward to the solution its now been moved to - I've created a workbook in Google Sheets and tied the integrations to this. This not only scales incredibly well, but you also have the luxury of cell-by-cell history out of the box. So, how to proceed? First you need to add the component using Composer : ...

Going Serverless!

So most of you have probably heard about this particular concept - " Serverless ".  I can't say I completely get the name of it, there is a server that is running it, the main difference is it only runs for the length of it to take to complete the computing of the function.  As far as the big players go - I generally have all of my stuff running out of Amazon - so for the purpose of this article, this is what I'm referring to. Lambda is the service of AWS where you can run your serverless functions.  Now sadly for us PHP developers, it does not support natively support PHP and until now, I haven't found a simple and easy to grasp guide without the need to use some elaborate framework that sits on top of it.  Until now... Be sure to take a look in to this guide from Amazon.  I was genuinely impressed.  The one thing it left out was that I got about up to the very end when I found my functions could not be invoked properly, and the reason being is that m...

WooCommerce: Turbo Product Imports

Well, this is really becoming a topic as part of a series !  Today's topic is going to be a little complicated, but it can really speed up any current integration's you may have between your WooCommerce and CMS/Product Management Systems you may have in place.  Let me first explain my current situation. The main issue, which turns in to a cumbersome work-around, is that our imges are all hosted on an external CDN.  As I have already covered , by using the REST API, despite you give the URL for each product's image, it still uploads it to the media library.  This comes at a cost of time, and for a heavy workload can be prone to connection timeouts. As part of my role, I put through many catalogues to a site, with a combined number of products in the 1000's - and it was quickly having to scale, so there had to be a better way.  I knew there were people who had desired to write posts directly to SQL , and what is a WooCommerce product? A custom post! Think L...