Jump to content

R4z3r

Member
  • Posts

    47
  • Joined

  • Last visited

Everything posted by R4z3r

  1. Hi Everyone, I've been working on putting together a TV show information workflow that will get you information about the TV show that you are searching for. I have it currently setup for two different options of handling it. This workflow shows you the Show Name, Show Status (Returning, On the Bubble/TBD, or Cancelled), and (depending on the status) air time, air day, and network or number of seasons it ran for on what network. See github for the most recent version, code, and configuration options. To switch between 12-hour time and 24-hour time, use the keyword: enable12hr or enable24hr These will switch whether the script displays 12 or 24 hour time. Current Version: 1.0 Option 1: Use the 'tv' keyword in the Alfred prompt to begin the workflow, then type the name of the TV show that you would like to search for and it will return the information about that show to you in the window. Pressing "Return" on the keyboard will open TVRage to the show's page.Option 2: Use a hotkey of your choice to pass your current text selection to the workflow and begin the search as above. Known issues that I am working on or that I am looking to add: TV Episode search (so you can find information about specific episodes) — BETA 12 hour time version (currently, time is displayed in 24-hour time) Fix "seasons" on cancelled shows to correctly match singular or plural numbers Add easier timezone support. Add Alleyoop Suport Download here: https://github.com/kkirsche/TVRage-Alfred_Workflow/blob/master/TVRage_Show_Search_RELEASE.alfredworkflow?raw=true Github can be seen here: https://github.com/kkirsche/TVRage-Alfred_Workflow Please let me know if you have any questions, comments, suggestions, etc. I hope you like it!
  2. Got it. Was just the last part that I needed. Thanks! I'll have that up soon. Still a number of features to add but I think you've gotten me to the point where it's just a matter of putting everything together and adding all that I want to add to it. Thanks for your help!
  3. Ah, that was it. For whatever reason when I cloned it from github it must have been cut off. I fixed the timezone set issue with date_default_timezone_set() in the script to let users set their timezones. Thanks! Also, how would I use the arg="" value and open that value in the browser? (so if someone presses enter on it, I send the arg value to the default browser to be opened. Thank you again for your help.
  4. Would it be possible to grab the input, and run an if () else () on the input if it's greater than or less than a certain number of characters (assuming that the length could provide you enough time for this). Just an idea, not sure if it would solve the problem here.
  5. Print and echo each do the same thing (of nothing for me in this case). When running it via terminal, it seems to work correctly as well. There was one error related to strtotime() which was easily remedied. But even after fixing that, I have been unable to get this to work. Everything there seems to be correct which is why it's confusing me so much. Formatted on pastebin: http://pastebin.com/NYtPNEqx
  6. So using the workflows class I was able to get the XML generated but for some reason not sure how to get it back into alfred. The XML I generated was (beautified a bit for easier reading): <?xml version="1.0"?> <items> <item uid="2930" arg="http://www.tvrage.com/Buffy_The_Vampire_Slayer" valid="yes" autocomplete="no"> <title>Buffy the Vampire Slayer</title> <subtitle>Buffy the Vampire Slayer is Canceled/Ended. It ran for 7 seasons.</subtitle> <icon type="fileicon">/Applications/Alfred.app</icon> </item> <item uid="31192" arg="http://www.tvrage.com/shows/id-31192" valid="yes" autocomplete="no"> <title>Buffy the Vampire Slayer - Season Eight: Motion comics</title> <subtitle>Buffy the Vampire Slayer - Season Eight: Motion comics is Canceled/Ended. It ran for 1 seasons.</subtitle> <icon type="fileicon">/Applications/Alfred.app</icon> </item> <item uid="21766" arg="http://www.tvrage.com/The_Vampire_Diaries" valid="yes" autocomplete="no"> <title>The Vampire Diaries</title> <subtitle>The Vampire Diaries is Returning Series. It ran for 4 seasons.</subtitle> <icon type="fileicon">/Applications/Alfred.app</icon> </item> </items> Full Unbeautified XML: http://pastebin.com/f33RF8Kg Full Beautified XML: http://pastebin.com/w2VWiN5s Sadly I don't know how to push that back to Alfred. I wanted to use the 'arg' value to open that URL. I'm passing yes to valid. Not sure how to go about it. I'm running it as a "Script Filter" (not sure if that's what I want to use or not for this). The code to generate the XML is: require_once('workflows.php'); require_once('TVRAGE/TVRAGE.class.php'); require_once('TVRAGE/TV_Show.class.php'); require_once('TVRAGE/TV_Shows.class.php'); require_once('TVRAGE/TV_Episode.class.php'); //create new workflow $w = new Workflows(); // Grab input $input = "{query}"; //Use the input to search TVRage $show = TV_Shows::search($input); //use foreach loop to set the information for each result foreach ($show as $each) { //set the information available to us $thisShow = array( 'uid' => $each->showId, 'arg' => $each->showLink, 'name' => $each->name, 'subtitle' => "", 'status' => $each->status, 'airDay' => $each->airDay, 'airTime' => $each->airTime, 'network' => $each->network, 'seasons' => $each->seasons, ); //set the subtitle based on the status of the show. We want the user to get information pertinent to the show. if($thisShow['status'] == "Returning Series") { $thisShow['subtitle'] = $each->name . " is a " . $thisShow['status'] . ". It is aired " . $thisShow['airDay'] . " at " . $thisShow['airTime'] . " on " . $thisShow['network'] . "."; } else if ($thisShow['status'] == "Canceled/Ended") { $thisShow['subtitle'] = $thisShow['name'] . " is " . $thisShow['status'] . ". It ran for " . $thisShow['seasons'] . " seasons on " . $thisShow['network'] . "."; } else if ($thisShow['status'] == "TBD/On The Bubble") { $thisShow['subtitle'] = $thisShow['name'] . " is on the bubble for being renewed. If it is renewed, it airs on " . $thisShow['airDay'] . " at " . $thisShow['airTime'] . " on " . $thisShow['network'] . "."; } else { $thisShow['subtitle'] = $thisShow['name'] . " is aired on " . $thisShow['airDay'] . " at " . $thisShow['airTime'] . " on " . $thisShow['network'] . "."; } $fileIcon = "fileicon:/Applications/Alfred.app"; $valid = "yes"; //$w->result(uid, arg, title, subtitle, fileicon, valid, autocomplete) $w->result($thisShow['uid'], $thisShow['arg'], $thisShow['name'], $thisShow['subtitle'], $fileIcon, $valid, 'no'); } // Return the result xml print $w->toxml(); Not sure how to interact with Alfred or that I'm using the classes in workflows.php correctly (i.e. $w->result). If you want to see the TVRage class I'm using: https://github.com/kkirsche/PHP--TVRage The Script filter options are set to: EDIT: Updated to more complex code. Same thing happens (i.e. nothing in alfred). Functions correctly (I think) as an independent script though. If it's any help, the workflow itself exported from Alfred: https://docs.google.com/file/d/0BxYIGe3RKbtKWk5Ib3NzeTRIMmM/edit?usp=sharing
  7. Well, I am trying (not so well) to create a workflow similar to Amazon Suggest using TVRage's API in PHP. Basing off PHP--TVRage (https://github.com/kkirsche/PHP--TVRage) it returns the info that I would want as an array similar to: TV_Show Object ( [showId] => 25050 [name] => Mike & Molly [showLink] => http://www.tvrage.com/Mike_And_Molly [country] => US [started] => 1284955200 [ended] => [seasons] => 3 [status] => Returning Series [classification] => Scripted [network] => CBS [runtime] => 30 [genres] => Array ( [0] => Comedy [1] => Family ) [airDay] => Monday [airTime] => 21:30 ) Not sure how to go about returning the results to Alfred using the information in the array or TV_Show Objects. (I.E. each potential match comes back with an array of that data. Buffy the Vampire Slayer for example returns like ~15 different TV Shows). How would I go about return the array data to Alfred?
  8. Nice! If you use this icon instead, it'll have a clear background instead of the white on in what you have now. Otherwise, it's great!: http://upload.wikimedia.org/wikipedia/en/0/0c/ITunes_11_Logo.png
  9. I know it's dumb, but did you double check that it's checked in Features > System? If so, have you tried changing the keyword to see if it works when changed?
  10. What he is asking for is to open '/Applications/Utilities/Console.app' It'll look like: He's asking if when you make that click, does something new appear in that right hand panel, and if so, what is it? (He uses stack trace logged out, one of the possible things console would say, as an example).
  11. That's fantastic! Great job!
  12. Hi, I was wondering if anyone was willing to write up an intro to workflow programming? I see it accepts a lot of languages, and I know PHP/MySQL, Ruby, some Ojective-C and whatnot, but I don't know how to leverage those languages to interact with Alfred in a workflow. Any help or recommendations you have for getting started with programming some more complex workflows are appreciated.
  13. I think that while some are upset, and I was at first, it's because they resist change personally. At the end of the day, re-examining how you use the app is worthwhile. With new additions, tons of changes, and whatnot, it was a refresher for me on what Alfred could do. While I was annoyed, it has added to my knowledge and increased my usage. Was it "a waste of time"? No. Basic settings are easy to copy over. Open both preferences next to each other and it takes like...20 minutes? More if you have more custom searches. But basic migration can be done by users, combined with David's scripts, I think it's a great decision that was made. Don't attack the developer for releasing a quality product that is significantly redesigned. You don't have to update today. You can do it when you have time. Great work to the developers. Keep it up.
  14. I have to say, at first I was annoyed. Workflows though has already been amazing. And for anyone complaining, there is a workflow, to migrate over custom searches, etc. It's really not that bad, and starting fresh let's you fix some bad habits and learn some features you weren't using before.
  15. If it helps, I was frustrated too until I started using workflows. Now I think it was worth it. I do wish I had just done the mega supporter instead of the single user when I upgraded. :\ maybe I can upgrade my single to mega supporter?
  16. Hey @nikipore, I'm not getting any action on any folder anywhere. They are the actual folders and not symbolic links as well. Whether it's the /etc/ or /Library/ or the Desktop as shown in that picture, none of them get me to see an action. I haven't been able to see "Add to Favorites" anywhere. The 'favs' keyword works correctly as expected (just shows that there are no favorite folders. EDIT: Figured it out, by default my settings in "File Search" > "Actions" > "Show Actions:" did NOT have -> as a command for show actions. The default was just fn or ctrl.
  17. Unless I'm doing something horribly wrong, I'm not getting a results actions from Alfred. It just stays blinking on this screen as an example. Nothing happens when clicking right, left, up or down. Turning on the File Search > Navigation > Use <- and -> for folder navigation works if I turn that on, but without it on nothing happens when clicking right arrow.
  18. Sorry, I didn't understand it. Thank you. You were right.
  19. I can't get this to work for the life of me. I installed it, I can browse using '/' but clicking the right arrow key on the keyboard does nothing. Not sure what I'm doing wrong here. Help?
  20. Is there a way to change the Hotkey trigger to a keyword tigger (inputs >keyword)?
  21. This is great. If it's ok to ask, how would I go about modifying it to copy the file and send it to a specific folder (of my choosing). If that's threadjacking, ignore the request and just know I appreciate this!
×
×
  • Create New...