As we approach the start of the 5th week of my internship at Punchmark, I’ll reveal a bit of the specifics behind what I’ve actually been working on.
- SMS Notification System
Punchmark would like to allow their clients to opt-in to SMS notifications for their store’s website. This way clients (jewelry retailers and vendors) can receive instant text notifications when a product is sold, account changes are needed, etc. The progress on this project has mostly me to thank as there was very little ground work laid before I started on it.
The first steps were to incorporate the ability to reply to STOP and HELP messages and unsubscribe users in order to comply with FCC regulations. Our messaging API, Twilio sents a POST request to a specified URL where a PHP script that I’ve written parses the request and compiles a message and takes necessary database manipulation action before sending a request back to the Twilio API to send a message back to the user.
- Testimonials API Streamlining
One of Punchmark’s newer features is the ability to congregate user reviews for a store from Yelp, Google+ Reviews, and Facebook Reviews. However, the code was hastily pasted together in one massive 1500+ line file. Then the same code was copied and tweaked slightly to another file to produce a preview version of these testimonials on the front page of the client’s site. I started working on testimonials because there was a fatal bug that caused results to fail because certain user’s profile pictures could not be retrieved.
I was tasked to debug this. I quickly took on the task of streamlining all of this code and needless requests. I separated the code into a PHP class, cached testimonial information (reviewer’s name, date posted, rating, review text, etc.) into a JSON file to be stored in the client’s folder on the server. If the file wasn’t too old the server would read from it when compiling testimonials to display. This cut down on page load time and also provided a failsafe for when the API failed.
- Moths, Bugs, and API Privacy Changes. Oh My!
Unbeknownst to anyone on the team, Instagram changed their privacy policy regarding access to API access to user images on June 1st 2016. Right about noon on that fateful day all of our Instagram widgets failed to display data. I was worried I caused the problem as I was working on API code as it happened. I quickly assured myself and everyone else I had nothing to do with the failure and we brushed it off as an error on Instagram’s part, until a week and a half later.
I was told to figure out what was happening and discovered a forum post citing the change in privacy settings. Our new solution is to use Instagram’s new method for retrieving user images. This requires a bit of code rewriting but most annoyingly, it required authentication from the user. The guys are crafting an email to send to clients asking for authentication.
I’ll likely be the one writing this new code and getting it all to function like it did before Instagram decided to change the rules.
For daily vlogs, follow me @robhossboss on Beme available on Google Play and iOS App Store
Leave a Reply