best gaming chair

Instagram Feed using Javascript and XSLT/XML

Recently an Instagram widget that we were using on a site broke when the Instagram API was upgraded/deprecated (I guess it depends on which side you are on). The widget was no longer supported, so we were looking for some workarounds/solutions.

We investigated moving to another commercial widget, building a script using their API and whatever other options we could think of. We found InstagramFeed on GitHub, which is a really cool Javascript.

The CMS we work in uses XML/XSLT for it’s templating, so using the CMS’s built in Components, we built a simple Component that would give a content manager access to basic form controls so to create/edit the script. We then wrote some XSLT to build out the script call and output to generate the InstagramFeed script on our website. Nothing too amazing, but not too shabby for the very short turnaround.

Here’s the XSLT we used to output the script with the options of passing:

  • feed name or type, @ username or # tag
  • number of items to display
  • number of items for row
<xsl:template match="div[@id='instagram-feed-comp']">
  <xsl:param name="feed-type">
    <xsl:choose>
      <xsl:when test="starts-with(@data-feed, '@')">username</xsl:when>
      <xsl:otherwise>tag</xsl:otherwise>
    </xsl:choose>
  </xsl:param>
  <xsl:param name="feed-name" select="substring(@data-feed, 2)"/>
  <xsl:param name="items" select="@data-items"/>	
  <xsl:param name="items-per-row" select="@data-items-per-row"/>	
			
  <div id="instagram-feed-comp"></div>
  <script src="_host-path_/instagram-feed-min.js"></script>
  <script>
  (function(){
    new InstagramFeed({
      '<xsl:value-of select="$feed-type"/>': '<xsl:value-of select="$feed-name"/>',
      'container': document.getElementById("instagram-feed-comp"),
      'display_profile': false,
      'display_biography': false,
      'display_gallery': true,
      'callback': null,
      'styling': true,
      'items': <xsl:value-of select="$items"/>,
      'items_per_row': <xsl:value-of select="$items-per-row"/>,
      'margin': 1,
      'lazy_load': true
    });
  })();
  </script>
</xsl:template> 

We hate XSLT, but you can do some very cool stuff with it if you can find good documentation and examples out there.

Once we make our template match, we’re assigning data attributes we have setup in our Component (not shared here) as XSLT params for later output. We create a new param feed-type that checks whether the feed-name starts with an @ or # to determine if it’s an Instagram account or a hashtag to display.

Next we just output a div for the script to append to, the include script for the Instagram Feed, and the function with options we want for our display. The scripts creators really did a great job documenting the options. GitHub and the web in general are so awesome at times!

We output XSL value-of’s where we want our Component values to output in the script. Again, very simple but works great without our CMS. A content manager can very easily add and update their Instagram feed on their respective page without knowing and Javascript or having access to source code.

Comments (0)

Recent Hobbies

I’ve found a few new hobbies/projects to learn during the recent pandemic. Some tech, some around the house, and others just random.

Vue.js

I’ve really gotten into the vue.js JavaScript framework. Recently I’ve been aiming to get stronger with JavaScript, and eventually found my way to Vue.

Thus far I’m using the framework to develop a degree/program finder at work, and another single page app for another project. I’ll have to write up a post on both projects when I launch them. Very excited.

Firebase

A bit tied together with my Vue interest, I’ve really been having fun with Firebase. Firestore and Authentication are what I’m mostly toying with at the moment. I am really excited to deploy into some final projects. The documentation is great.

Baseboard Trim

I finally put my miter saw to use and fixed the baseboard trim in my bathroom. Getting the trim to match at a corner was the biggest challenge.

Since some of the previous trim had gotten wet and moldy, I was able to salvage a piece of the clean original to match my corner, with a completely new piece of baseboard for the side with no corners. Very difficult to see the trim isn’t a perfect match on that piece.

Sprinkler Heads

Not too difficult, but I also dig up and replaced a few sprinkler heads. Installing and adjusting to get them just right wasn’t too hard. Just some trial and error, and digging.

RingFit Adventure

I have been playing RingFit Adventure for 90+ straight days now. While not a replacement for the gym, it’s been a pretty solid source of activity. It has me doing more core and balance work now, which is nice. Great idea making an exercise rpg, I think I’m up to level 106 now.

Kindle PaperWhite

One of the first (and few purchases) of the pandemic for me was a Kindle. It’s been awesome! Screen and battery are amazing, I’ve been borrowing books online through my local library. Probably have read 8 or so on it.

Comments (0)

My Pandemic Birthday

So this birthday was a bit different as it took place during a pandemic. So that ruled out adventuring somewhere, getting something to eat out, etc.

The day started with with my kind co-workers all putting up custom birthday themed backgrounds for our Microsoft Teams meeting. That was a very nice of them, it was funny. I also received some pretty amazing videos and greetings on social media.

Of note was an amazing happy birthday song my Michale Bolton and the most epic happy birthday video I’ve ever seen. I still chuckle at both while typing this.

After work I stopped over to my parents. Had dinner with them and we had some ice cream cake. The cake was great, it was from Dairy Queen and I have to admit it tasted much better than in the past. I think I was told they’re under new ownership, not sure.

Stacey stopped over the next day and brought some gifts with her. Got some nice dumbbells (couldn’t of been too fun for her to carry them up my steps), The OuterWorlds for PS4, an Escape the Crate escape room in a box, and The Master Theorem book.

The dumbbells are great. Not able to go to the gym, they’ll really come in handy. They’re nice ones too, not something you get at a yard sale. The Escape the Crate was great. It comes with 2 escape rooms, and we went through one of them that night. It was challenging, but very fun. A great idea.

The Master Theorem book has been quite the hit thus far. It’s full of really complex and unique puzzles. They’re tough, but it is very satisfying when you solve one. Highly recommended.

As well as a Lego mini-figure I also got an ice cream pie and a pint from Springer’s in Stone Harbor. Amazing ice cream, and a big surprise. Several days later I would begin to regret so much ice cream at once, but it was fine to have such treats!

So while it was a bit different without being able to go places, I was still quite happy. Definitely a memorable b-day!

Comments (0)

1st Week Working from Home

Due to the COVID-19 pandemic I started to work from home beginning last Wednesday. Work had been extremely busy and at times stressful dealing with the unique and trying situation, so social distancing is being put to the test.

Working on the web, my role translate favorably to a work at home schedule. My trusty MacBook Pro can handle any task I would have done in the office. So technology isn’t much of a concern. How things go without being able to interact directly with humans will be the true challenge.

The first few days were extremely busy. This in uncharted territory and our team is very busy and doing as best a job as we can given the circumstances. so even though I’m home, I’m still very much occupied.

I’m been able to communicate with the rest of my team via email and with our latest addition to our toolset, Microsoft Teams. When we found out late on Tuesday we would be working from home beginning the next name, I immediately had us setup some Teams and we gave ourselves a quick 10 minute run-through of how we may be able to use it from.

All things considering, it’s been working extremely well thus far. Everyone at our institution is available in the chat (assuming they’re using it), so that’s a huge plus for us. The video chat quality and ease of use has been most impressive. We have 14 users, with probably 10 or 11 using the video chat and the rest on audio chat with no issues. As clear as can be.

Microsoft Teams will officially be a part of my daily work going forward, even when we do return to the office. It’s been a great friend.

Work from Home Tools:

  • MacBook Pro 13″
  • Office 365
  • OneDrive
  • Google Drive
  • Adobe Creative Cloud
  • Visual Studio Code
  • Microsoft Teams
  • GitHub
  • A chair and table (it’s not a very comfy chair)
  • A place to stand and work (using an exercise mat to stand on really helps)

Supervising looks to be interesting. Teams has really done a solid job of making it not too awkward. We can have meetings without too much issue, sharing our screens when necessary, and just using old fashioned chat and link/file sharing to get the job done. Thus far not losing too much of a step.

The first week we were so busy in crisis mode, we didn’t have to get too creative in coming up with projects and managing folks. I’m sure the next days will be similar, but it will be interesting to see how it goes should things slow down. I’ve always been a self starter, but I’d like to see how everyone else adapts as well.

Comments (0)

Joe the Plumber

I was very proud of my plumbing achievements this weekend. First, I successfully replaced my garbage disposal.

My previous garbage disposal was getting a bit old, needed frequent resets and I suspect early stages of leaking too. I went with an identical model, as it seemed to be an easier replacement.

All in all it took me probably a half hour to complete. If did require wiring, so bonus electrical work for me.

I know it’s not much, if I was impressed and proud to of done it myself without any left over parts or wads of duct tape used.

My second plumbing task was replacing a sink drain. This was a little bit tricky, I was having a hard time reaching a couple of the necessary parts.

After a bit of sleuthing, was able to get to everything and with way too much plumbers putty, no leaks!

The ball rod was of bit of a puzzle, but I do think I figured it out. Future attempts should be much easier now.

All in all, I was proud of my plumbing weekend!

Comments (0)

Lipoma

I noticed a little lump around my temple a couple of years ago, and made an appointment with my doctor to take a look. He set me up with a CT skull scan and they scotch taped a tums to my lump and ran the scan (apparently a 5 cent calcium taped to my head helps a very expensive machine give a more accurate result).

The scans at the time said the lump was a lipoma. A lipoma is just a growth of fatty tissue (guess I had a fat head), and are almost always benign. Which was a relief to hear.

The next step was to go to a plastic surgeon to have him take a look at it. For some reason going to a plastic surgeon spooked me a bit. Not sure exactly why, but I think I was just afraid I’d leave looking like Michael Jackson or something like that.

I nervously went to my appointment, and he confirmed he suspected it to be a lipoma and said he could easily remove it. I opted at the time to just leave it alone, nobody had yet to notice it beside myself and keep an eye on it in case it continued to grow or change.

A year later I’m pretty sure it grew a little bit and got it checked out again, but again opted to just leave it alone. I wanted to get rid of it, but was just too chickened out at to have it removed. I still feared looking like Michael Jackson.

Two years later I finally made up my mind to get this guy removed. I think it’d grow quite a bit more, though still nobody ever mentions it to me. But once I’d point it out to someone, they then saw it. I just didn’t want to wait until it got much bigger. It’s around my temple and I the larger it got then the trickier the procedure could be to remove it.

I made my appointment with Dr. Rayfiend (who was great) and got my jitters out of my system before going over. I was fine once I got there. I didn’t have to go to sleep for the procedure and it probably took a half hour total.

It was interesting in that I couldn’t feel anything being cut, etc. but being around my temple I could hear every cut, tug, etc. very loudly as it was so close to my skull.

Once he was in there, I knew pretty soon that it was giving a bit more trouble than was originally expected. When the doc asked for the cautery, I knew it must be in there pretty good (I watched a lot if not all YouTube videos on the procedure beforehand as if it would make a difference). He said it was in pretty deep and likely in there for over ten years.

He finally got it out and stitched me up. It wasn’t too many stitches and he did a great job in making the incision in an area where any possible scarring wouldn’t be too bad (around my hairline). He showed the lipoma to me when we were all done. I didn’t bring my camera with me, but it was a fairly gross yet smooth yellowish mass.

I went to work the next day, I think only 2 people bothered to notice the excision and stitches the following week. Either they are blind or don’t pay attention to me, or felt uncomfortable to ask what had happened. It probably just looked like I got into a little fight or hit my head on something, it wasn’t too bad considering how much came out.

Stitches came out a week later, and they were happy with how it was healing up. Results came up benign, with again was great as there is a tiny percentage where they can come up to be bad.

So now I’m just waiting for my little scar to fade away and my head to finish healing up. Outside it looks fine, but inside I can tell that it’s still healing up a bit. Should be all good in another week or 2.

Dr. Rayfield did an amazing job and made the process and easy and relaxing as could be. I’m finally glad I got that stupid bump/lump removed and am glad it wasn’t anything too dangerous.

Comments (0)