Product Corner: Keith's janky fix for the Marvel Unlimited "problem"

Wherein Keith attempts to "fix" Marvel Unlimited, widely used product beloved by millions

This is a follow-up edition of Product Corner, my very un-regular column containing my whines about this or that digital product. My "solemn" "oath" is that I will try to come up with a "solution" to the "problem" described in the previous order. This edition attempts to "resolve" the problem described here.

So, roughly a week or so ago, I wrote this article, and a few days ago, I published it! In the interim, I performed my solemn duty to try to go beyond the purview of a product manager and actually tried to solve the problem. This is very challenging, because not only do I only really know Python, I'm not even really proficient at that. I do not promise that the solution is well-engineered – hell, I don't even promise that the solution is good, but I do promise that I'll try.

To re-summarize the problem, comics have long, weird, complicated arcs that span different superhero books and are designed to be read in a certain order, but the Marvel Unlimited applications for tablet and phone make it challenging to read these issues in any order but issue by issue for a given book. So, if an event occurs in all of X-Men, The Avengers, and Spider-man, the app still wants to push you issue by issue through one of these series, rather than allowing you to hop between the series in the designed order.

Marvel Unlimited does have suggested reading orders, but the reading flow ignores those orders, and so the user does a lot of searching and bopping around and getting lost and frustrated. Read Friday's Corralling the issue sprawl problem in Marvel Unlimited for more on the "problem" at hand.

So, how does one man with limited skills "fix" this? With rudimentary Python! My thought was that it would be pretty straightfoward to take a decently formatted text file, parse it out, and then find the web page for that issue on marvel.com. Then, a little review of the source code for those pages shows me that I can find something called a digital_comic_id , which I can use to build a URL that will take me to the comic in Marvel Unlimited. Then, maybe I can package up all those URLs into an HTML document that kinda sorta does what I wish the Marvel Unlimited app would do for me – give me a list of exactly the issues I want to read, and let me tap on them to open that issue, right in MU.

Here's what I ended up with:

GitHub - kdadair/comics-reading-order: A mediocre-yet-functional way to turn a list of Marvel issues into an HTML document of links to Marvel Unlimited, decently formatted.
A mediocre-yet-functional way to turn a list of Marvel issues into an HTML document of links to Marvel Unlimited, decently formatted. - GitHub - kdadair/comics-reading-order: A mediocre-yet-functio…

I take in a path to an input text file that looks like this – Book #issuenumber (year):

Secret Warriors #1 (2009)
Secret Warriors #2 (2009)
Secret Warriors #3 (2009)
Secret Warriors #4 (2009)
Secret Warriors #5 (2009)
Secret Warriors #6 (2009)

Then, I do a bunch of junk! That functionally involves taking each line of the text file and jamming it rudely into DuckDuckGo along with a string that gets to where the comics issues are on Marvel.com –   site:marvel/com/comics/issue/. I grab 10 results from DuckDuckGo, and then use a somewhat janky "algorithm" to compare each search string to the slug at the end of the URL that DuckDuckGo gives me. Here's an example URL slug: shield_2010_1; series, year, issue. I then compare the user-supplied issue number, year, and words in the series ( issue_no, year, and book_words) against the matching data points in the slug ( mu_issue_no, mu_year, and mu_book_words):

if issue_no == mu_issue_no and year == mu_year:
	for book_word in book_words:
		if book_word in mu_book_words:
			comic_url = result['href']
			break
	break

Essentially, it checks to see if the issue number and the year match, and then sees if any of the words in the title of the comic the user gives us are in the one in the url slug.

Then, I use a little godforsaken regex to find what's called the digital_comic_id, which I can use to make the URL that cracks open the issue in Marvel Unlimited – easy!

match = re.search(r'digital_comic_id: "(\d+)"', script_text)

Then I do that again for every issue in the list, and then I throw them all into an HTML document, which I can then just open in a web browser, or serve to my local network, or copy and paste somewhere!

HERE'S A GIF!

Anywho, it ain't perfect, but it really mostly works, and I've actually been using it to make my way through a big ol' run of Hickman issues – here's the output of the script for that run – if you are a user of Marvel Unlimited, the links below will open right to the issue in the app!

Hickman's Run through S.H.I.E.L.D. and Fantastic Four stuff in like 2009

Dark Reign: New Nation #1 (2009)

Secret Warriors #1 (2009)
Secret Warriors #2 (2009)
Secret Warriors #3 (2009)
Secret Warriors #4 (2009)
Secret Warriors #5 (2009)
Secret Warriors #6 (2009)

Dark Reign: Fantastic Four #1 (2009)
Dark Reign: Fantastic Four #2 (2009)
Dark Reign: Fantastic Four #3 (2009)
Dark Reign: Fantastic Four #4 (2009)
Dark Reign: Fantastic Four #5 (2009)

Dark Reign: The Cabal #1 (2009)

Secret Warriors #7 (2009)
Secret Warriors #8 (2009)
Secret Warriors #9 (2009)

Dark Reign: The List: Secret Warriors #1 (2009)

Secret Warriors #10 (2009)
Secret Warriors #11 (2009)
Secret Warriors #12 (2009)
Secret Warriors #13 (2009)
Secret Warriors #14 (2009)
Secret Warriors #15 (2009)
Secret Warriors #16 (2009)

Fantastic Four #570 (1998)
Fantastic Four #571 (1998)
Fantastic Four #572 (1998)
Fantastic Four #573 (1998)
Fantastic Four #574 (1998)
Fantastic Four #575 (1998)
Fantastic Four #576 (1998)
Fantastic Four #577 (1998)
Fantastic Four #578 (1998)

S.H.I.E.L.D. #1 (2010)
S.H.I.E.L.D. #2 (2010)
S.H.I.E.L.D. #3 (2010)
S.H.I.E.L.D. #4 (2010)
S.H.I.E.L.D. #5 (2010)
S.H.I.E.L.D. #6 (2010)

Fantastic Four #579 (1998)
Fantastic Four #580 (1998)
Fantastic Four #581 (1998)
Fantastic Four #582 (1998)

Siege: Secret Warriors #1 (2010)

Secret Warriors #17 (2009)
Secret Warriors #18 (2009)
Secret Warriors #19 (2009)
Secret Warriors #20 (2009)
Secret Warriors #21 (2009)
Secret Warriors #22 (2009)

Fantastic Four #583 (1998)
Fantastic Four #584 (1998)
Fantastic Four #585 (1998)
Fantastic Four #586 (1998)
Fantastic Four #587 (1998)
Fantastic Four #588 (1998)

Secret Warriors #23 (2009)
Secret Warriors #24 (2009)
Secret Warriors #25 (2009)
Secret Warriors #26 (2009)
Secret Warriors #27 (2009)
Secret Warriors #28 (2009)

S.H.I.E.L.D. #0 (2011)
S.H.I.E.L.D. #1 (2011)
S.H.I.E.L.D. #2 (2011)
S.H.I.E.L.D. #3 (2011)
S.H.I.E.L.D. #4 (2011)
S.H.I.E.L.D. #5 (2011)
S.H.I.E.L.D. #6 (2011)

FF #1 (2011)
FF #2 (2011)
FF #3 (2011)
FF #4 (2011)
FF #5 (2011)
FF #6 (2011)
FF #7 (2011)
FF #8 (2011)
FF #9 (2011)
FF #10 (2011)
FF #11 (2011)

Fantastic Four #600 (1998)

FF #12 (2011)

Fantastic Four #601 (1998)

FF #13 (2011)

Fantastic Four #602 (1998)

FF #14 (2011)

Fantastic Four #603 (1998)

FF #15 (2011)

Fantastic Four #604 (1998)

FF #16 (2011)

Fantastic Four #605 (1998)

Fantastic Four #605.1 (1998)

Fantastic Four #606 (1998)

FF #17 (2011)

FF #18 (2011)

Fantastic Four #607 (1998)
Fantastic Four #608 (1998)

FF #19 (2011)
FF #20 (2011)
FF #21 (2011)

Fantastic Four #609 (1998)
Fantastic Four #610 (1998)

FF #22 (2011)

Fantastic Four #611 (1998)

FF #23 (2011)

Is it cute? NO. Is it functional? YES. Am I actually using a thing I made? Yes? I kind of even like it!

PRODUCT CORNER OVER.