YouTube Scraping, XPath, and Google Sheets

APIs can give you much more power but they are often overkill for what people are trying to around here- lightweight social media Here’s a lightweight example of how you can use Google Sheets and the IMPORTXML function to grab quite a bit of data from various video pages with no API or technical skills. Straight off, we’re going to want the URL of the video. We’ll put that in column A and we’ll use it as a variable in all our other formulas. Getting the Paths to the Data =IMPORTXML(A2,”(//*[contains(@class, ‘watch-title’)])[1]”) So how’d that come to be? A2 is just asking what URL we want to go to. The XPATH stuff gets a little more interesting. It’s going to look for any class that is named watch-title. I found out the title was in that div by right clicking on the title and choosing inspect in Chrome. The appended [1] will only give us the first item that meets those qualifications. Otherwise the title shows up twice. The rest of the formulas are pretty much variations on that theme. =IMPORTXML(A2,”//*[contains(@class, ‘watch-view-count’)]”) – View count =IMPORTXML(A2,”(//*[contains(@class, ‘like-button-renderer-like-button’)])[1]”) – Likes count =IMPORTXML(A2,”(//*[contains(@class, ‘like-button-renderer-dislike-button’)])[1]”) – Dislikes count =IMPORTXML(A2,”(//*[contains(@class, ‘yt-user-info’)])[1]”) – User name Throw in a video of your own if you’d like.


Weekly Web Harvest (weekly)

Fan Is A Tool-Using Animal—dConstruct Conference Talk “But the fanfic people were doing something very different. They had converged on a set of elaborate tagging conventions that allowed them to turn Delicious into a custom search engine for fanfic.” “In my foolishness I asked, “Could you make me a list of those features? I’ll take a look, maybe some of it is easy to implement.” Oh yes, they could make make a list. I had summoned a very friendly Balrog.” “Here I’ve shown a paragraph where someone asks me if I can build a user search feature, and I reply at length about why that’s not trivial. At that point someone decides that it’s easier for them to just go build the feature on the spot. They set up a little app in Heroku that mapped Pinboard usernames to Delicious usernames. In the time it took me to explain why I couldn’t build the feature, someone did it for me and stuck a hyperlink into this document that is spiraling out of control.” @ddmeyer The other interesting analogy to the MTBoS I like is pinboard/fanfic: https://t.co/q9XVxshFUs tags: #fav folksonomy tagging fan construction weekly tag knowledge structure bookmarks thoughtvectors fanfic The Echo Chamber “how do folks continue to ignore facts? How have people’s viewpoints become so insular and isolated that any […]

Radioactive Collage Maker

Radioactive is the book that VCU’s first-year students are reading. It’s an interesting book with interesting art and collage playing a major role in the design. I hadn’t really looked at it until this morning but I ended up in a conversation and an idea came to mind. “What if we could deconstruct elements of the text (words and images) and give them to students to recombine in interesting ways?” It seemed like a fun thing to do and within reach based on work I’d done earlier with Google Spreadsheet Fridge Poetry but I wanted a few more capabilities to help people create better visual products. I took my phone and took a bunch of quick pictures of pages from the book that seemed interesting and easy to cut out. That took about 10 minutes to photograph and drop the backgrounds.1 Another 10 minutes and I had a working prototype using the old Google Fridge Poetry. Not bad but I wanted to be able to rotate/resize images and be able to save the results as an image file (something I tried but failed at doing last time around). Resizing It turned out resizing was built into jQuery with the resizeable. $( “.resize” ).resizable(); Nice but it resizes the element holding the image rather than the image itself . . . […]

Random Stuff I Learned This Week

I’m messing around with some workflows to figure out how I’m spending some of my time . . . and, as a result, spending some of my time on how I spend my time. One of those efforts is trying to get some decent numbers around how my own efforts towards rampages support are going. I have my gut feelings but figured I’d see if I could work out a low energy way to document some of it in a more specific manner. I’m currently playing with a simple IFTTT recipe. It takes an email to a specific address with a specific hashtag (#vcusupport in this case) and puts it into a spreadsheet. I modify the subject line so that it’s #vcusupport HELP ME! | faculty | aggregation |. The regex1 below pulls out the elements and puts them in separate columns. Giving me something like the data below. Grabs content between two characters (in this case my “pipes”). =REGEXEXTRACT(B:B,”\|([^()]+?)[\|].*?(([^()]+?)[\|])”)) I started to do some work with Zapier as well. I actually prefer it in a number of ways (much more granular data and other neat things to pull from email) but the price was way too high for this type of use. I might try a more direct API route within Google if I end up feeling the need […]


Weekly Web Harvest (weekly)

nardove : computer artist enthusiast “This is my personal space where I share my adventures and experiments within the fields of interactivity, generative visuals and computer graphics, I do it as a hobby and somehow never seem to get enough of it 🙂 “ tags: weekly computer play programming art These Misconceptions Are Keeping School in the 1960’s | ThinkThankThunk “The most important thing about BIG is that we know we’re wrong. We don’t know what a student should know. We can’t predict the future. When working with a group, we allow the needs of the group to dictate the instruction and curated content we provide in response to the need. This has two effects: I like my job and am happier, and the students are never hidden from the planning of learning. “ tags: learning education student weekly My Bathroom Mirror Is Smarter Than Yours — Medium tags: diy mirror smart iot weekly The Zeigarnik effect: the scientific key to better work – Sandglaz Blog “A study published in the Journal of Personality  in 2006 showed that the Zeigarnik effect is undermined by reward expectancy. The study had subjects working on a task, interrupting them before the task was finished. While one group of subjects was told that they would receive an amount of money for participating in the study, the […]