A while back I was messing with getting Instagram data without bothering with their API because I think their most recent API changes are really annoying. I’m also a bit fascinated with the scale of numbers in social media right now. I opted to look at Snoop Dogg’s Instagram followers and plot their change very 10 minutes. Click here or on the image to see the live chart. Get the Instagram Data w/o the API & Put it in the Database It turns out that each Instagram page has an embedded JSON file with the data I wanted. You can see it if you view the source of any page. This Stackoverflow post was kind enough to point it out and you see regex rearing it’s head again. I started out with my standard process of using Google Sheets as the database but decided I’d try MySQL because I wanted to try getting the JSON ought more cleanly. The chunk below grabs the data and puts it in the database. So that gets us the stuff we want in a nice little box on the Internet. I did try to do some fancy mysql stuff to avoid entering the change in followers as an additional field but I failed in enough ways that I just opted to proceed with the […]
I had an interesting conversation with a pair of elementary school teachers. It led to me saying I’d put our two older kids on Good Reads in lieu of some less pleasant ways of documenting their reading. It’s not a place I’d necessarily drop a group of 3rd graders. As we spoke, I figured I could build a little version of one very quickly with Angular and a Google Form. It’s worth noting that once you set up one Angular page tied to a Google Sheet, you can just copy that over and make websites very, very quickly. It’s just a matter of re-aligning the json data. I hadn’t done anything with Angular in a while and while doing this I found out a few other neat little tricks that’ll be of use at some point. One was this slick star rating CSS option. It will show the star rating based on a div percentage. I really liked it but my rating scale was 1 to 5 and Google didn’t really support doing something with percentages. However, I didn’t realize you could do math right in Angular. It turns out you can and I did it like so. The entry.gsx$_cyevm.$t part is just the name of the data chunk that holds the 1 to 5 rating scale. I can divide […]
I made a filter a while back to keep people who were associated with blogs through the bbpress/buddypress auto-enrollment feature from having tons of sites show up in their My Sites list. It was never a perfect solution and felt sloppy because it relied on having only one role and that role being bbp_participant. It also failed when I un-network activated bbPress because it couldn’t filter people who had no role (and there was still some invisible connection). And the final nail was that it seemed to fail intermittently and I had no idea why. Here is a very different path to the same result but one that appears to work better and will be proof against the ‘no role’ issue that hampered me earlier. It’s all made possible by the delightful array_interesect function. It’s one of those things that I am confident I’ll use down the road. I have no idea if it’s as commonly known as ABC or whatever but I had no idea it existed. This actually came to fruition on a plane trip because Mark Luetke told me about Varying Vagrant Vagrants and I was able to spend about twenty minutes working on this even without Internet. It has also made me reflect that lack of interruptions really improves my productivity on things like this.
“I wear a stethoscope so that in a medical emergency I can teach people a valuable lesson about assumptions.” tags: assumptions weekly Like This So I Know I’m Real | Hazlitt “For my own peace of mind, I recently did a massive Twitter purge. Usually, this undertaking is a pragmatic one: A prioritization of voices to quell the overall noise. In my case, though, it was a matter of neurotic self-preservation. I know that there are all sorts of complicated reasons why people get ignored on Twitter, ranging from safety concerns to finer points of identity. I know the difference between exclusion and rejection. I also fully get that some people are so inundated that they can’t possibly respond to each and every query; this is the readily apparent nature of Twitter hierarchy. And there’s a vast sense of entitlement in thinking that anyone should engage with you. But we’ve all had the experience of finding out that a peer has unfollowed us, or felt rebuffed after trying to strike up a conversation and failing. It’s not a good feeling. And it’s in the very DNA of social media.” tags: socialmedia social twitter weekly purge Searching for examples — Medium An interesting pattern to think about as we try to capture examples at larger and larger scales tags: github scale blocks data […]
I was just messing around a bit more with mashing up the YouTube API post from earlier with the Twitter post from earlier today. This Google Script will get the view count of a particular video (Gangnam Style) and send out the total views and the time elapsed watching the video (assuming I did the math right). It has no real purpose (other than the scale of the number amuses me) but it’s one of those things with concepts that I’ll be able to apply more usefully in the future. That’s a gut feeling but I’m pretty confident. Don’t forget to add the Twitter library as directed here.1 1 in the Apps Script project, include the library MKvHYYdYA4G5JJHj7hxIcoh8V4oX7X1M_ with the identifier set to Twitter
flickr photo shared by Thomas Hawk under a Creative Commons ( BY-NC ) license Reclaim Hosting has a great status page that alerts you when stuff is not working correctly. We had a brief outage this morning and I just thought it’d be nice to see if we could proactively send out a message based on that status page but only for things relevant to our server. I asked Tim (as you can see in the tweets below) and ended up with an API that happily spit out a JSON feed. @ReclaimHosting ha ha – LOVE IT https://t.co/UrlIvwa91S — Tom Woodward (@twoodwar) February 24, 2016 Based on my recent experiments with JSON and Google Scripts I didn’t think it’d be too hard to write something to send out Tweets based on that feed. I found this snippet that dealt with the authorization portion for Twitter.1 Once I had the JSON parsed and assigned to variables, all I had to do was set it to check every 5 minutes. Now we can hook it up to the ALTLab account if we’d like, have it notify various people, etc. etc. Fun stuff . . . all done during lunch. The following script will check a JSON feed and send a Tweet out from my account letting @vcualtlab know we should check on […]
MCAFEE: I’ll decrypt San Bernardino phone free – Business Insider “Cyberscience is not just something you can learn. It is an innate talent. The Juilliard School of Music cannot create a Mozart. A Mozart or a Bach, much like our modern hacking community, is genetically created. A room full of Stanford computer science graduates cannot compete with a true hacker without even a high-school education.” tags: weekly education innate Building Concentric Circles with Nice Color Palettes For Fun and Science – The Media Temple Blog one of those pretty explorations across a variety of webdev/design/thoughtvector-ish fields tags: circles color webdev design weekly Try WorkFlowy Instantly slick tag based sorting features which open up some interesting options tags: tool todo list workflow weekly A Mathematician’s Lament ““Of course!” he reassures himself, “No society would ever reduce such a beautiful and meaningful art form to something so mindless and trivial; no culture could be so cruel to its children as to deprive them of such a natural,satisfying means of human expression. How absurd!”h/t thinkthankthunk tags: education math music programming weekly Ruth Goodman’s How to Be a Tudor, reviewed. “As a sort of control, a colleague of Goodman’s experimented with showering every day while wearing the same clothes, unwashed, for several months, and “the smell was overpowering.” Therefore, Goodman concludes, “the 16th-century belief […]
Because I love Alan. Here’s the API version in Google Script to grab YouTube stats. It does a bit more than the previous XPath version and you can set it to be triggered repeatedly. I’m going to add a loop to add multiple videos etc. in the near future but it’s a good start for anyone who’s doing research on stuff like this. It is funny what you might notice when you can see the data like this. I triggered it manually twice just to get a few lines in there. Notice that between the first two entries there are no additional views but a chunk more likes/dislikes. Makes me wonder if people are just weighing in without watching or if the data are collected differently resulting in some delay. Here’s the script1 and it’s pretty well commented up. You’ll need an API key. 🙂 You do see some weird stuff in the raw JSON. Like there’s a Favorites field. Does that exist in YouTube? I didn’t really think about it until it came up 0 for every video . . . even Gangnam Style. Here’s the result running every hour on a video that I’m hoping changes a bit. I got it off the trending page so it has to be cool right? 1 It took me a good […]