Created
February 27, 2014 09:51
-
-
Save alexstone/9247230 to your computer and use it in GitHub Desktop.
Revisions
-
Alex Stone created this gist
Feb 27, 2014 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,44 @@ <?php system('clear'); // $string = "Iron Man Vol. 5 #23.NOW"; // $string = "Ms. Marvel (2014-) (Vol. 13) #2.NOW"; // $string = "Uncanny X-Men Vol. 3 #19.NOW"; $string = "Winter Soldier: The Bitter March #2 (of 5)"; echo $string . "\n"; // Parse out the ttle for the key list($key, $junk) = explode('#', $string); echo "Key: " . $key . "\n"; // Parse out the issue number $issue_no = preg_match('/\#(\\d+)/', $string, $issue_no_data); if($issue_no) echo "\nIssue No: " . $issue_no_data[1]; else echo "\nNo issue number"; // Parse out the volume number $volume_no = preg_match('/Vol.\ (\\d+)/', $string, $volume_no_data); if($volume_no) echo "\nVolume No: " . $volume_no_data[1]; else echo "\nNo volume found"; echo "\n\n"; // http://feeds.feedburner.com/ComixologyDigitalComics // Parse out and break off the issue number // Try to find the volume with a generated title-volume key (comixology_key) // If we can't find the volume // Parse the title // Parse the volume number (assuming 1) // Find the title // If no title found, create one // Find the title->volume // If no title->volume found, create one // Check for an existing issue // If no issue, create a new one // If issue found, update with Comixology data (description, release date, price [if missing], comixology_url)