Skip to main content

Posts

Documenting Version Control

I had my mid-year review yesterday, and delighted to have good comments from my boss for my contributions to all of our current projects.  The main thing he highlighted to me is that I should communicate my changes a bit more - perhaps an email/slack message at the end of the day, or better yet - some form of change log .  Definitely a good piece of constructive criticism. So I woke up this morning ready to find a good method to keep this to my routine, and to be honest, I was fairly let down with the tools that were off the shelf.  A simple Google search revealed mainly just how different groups defined the term, and maybe a couple of templates here and there.  I thought, what is the best way to document changes as well as to link those entries to the respective files and where they were changed.  My target audience is only the small team that I work alongside. And then it hit me; up until then I had not used GitHub releases, as I was only ever the sole develop...

Requests with Node

This is going to be just a quick entry today, and when I was thinking of what to write about, it dawned on me just how much research I had gone in to in making different types of requests (https) in Node.  Took me a while to first have it so it was able to switch between a GET and a POST of JSON data, but then when I needed to make changes on how I would post Form data (including a file attachment) was another kettle of fish - steam rolled at every turn. So - let me help take you out of your misery.  Here is my base function and its required required libraries: An example of using this would go like follows. form = {      file: '@/tmp/path/to/filename.txt',      comment: '' }; request("POST","www.server.com","/",{},{'Custom-Header':'Custom-Value'},form) .then(res=>{ //console.log(res); //... }) .catch(err=>{console.log(`Request Error: ${err}`)}); This will send form data, including the filename you specified in to the ...

Life in Lockdown

I'm sure it will come as no surprise that the reason it has been so long since I have published a post is because all of our lives have been turned upside down during this current crisis.  My heart goes out to everyone doing it tough, as so many jobs - including people close to me have had their jobs be made redundant.  Fortunately in my position, things have only gotten busier. My day job is for a company in the field of wholesale distribution, and the when the virus has put us in lock-down, the Government called upon our company and other retailers to have a deliverable solution for essential items.  Proud to say that while our company has never pulled something like this before - we did so in only 8 days .  It only offered 4 item as packs of essentials, but we saw a great proof of concept. Just as quickly, has it now expanded to the full product line, with registration now open to all and not those just who are most at risk.  The solution we have applied is s...

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.