Batch Changing Facebook Album Descriptions

Interlinking multipart albums.

I am doing an internship at Nara Institute of Science and Technology for 2 months. During my time here, I traveled a lot and took many photos, and uploaded them to Facebook.

The problem is that when there are so many photos in a single album, performance degrades (and kind of make it hard to manage the photos).

So I split my album into many parts (one for each week).


The problem: Make these albums interlinked by putting links in the description of each album linking to other albums.


Browser Automation

It lets you control any web browser supported by Selenium WebDriver, including Firefox and Chrome.

Logging in to Facebook

I then logged in to Facebook inside that profile, so I don’t have to write code to automate the login process.

Updating Process

  1. The text file containing the description is read.
  2. Album URLs are scanned.
  3. For each album, its description is updated according to the text file.

The Script

The code is reproduced here:


Usage

Include the URL of each album inside the text file, since it is used by the script to scan for albums to update. For example:

This is the description of the album.
This album contains many parts.
Part 1: https://www.facebook.com/dtinth/media_set...
Part 2: https://www.facebook.com/dtinth/media_set...
Part 3: https://www.facebook.com/dtinth/media_set...

Then run the script:

ruby album_description.rb path/to/file.txt

You should see something like this:

== Album Description Updater ==
There are 2 albums whose descriptions are to be updated!
- Updating: NAIST Internship [Week 0]
- Updating: NAIST Internship [Week 1]
All done!

Further Work

  • including the album number in the description (e.g. this is album 1 of 3).
  • setting a different description for each album.

Code, Applied to Life

Stories about how coding can be applied to solve everyday…

Thai Pangsakulyanont

Written by

(@dtinth) A software engineer and frontend enthusiast. A Christian. A JavaScript musician. A Ruby and Vim lover.

Code, Applied to Life

Stories about how coding can be applied to solve everyday life problems. (Formerly Ruby Everyday).

Thai Pangsakulyanont

Written by

(@dtinth) A software engineer and frontend enthusiast. A Christian. A JavaScript musician. A Ruby and Vim lover.

Code, Applied to Life

Stories about how coding can be applied to solve everyday life problems. (Formerly Ruby Everyday).

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store