Jump to content

jp888

Member
  • Content Count

    8
  • Joined

  • Last visited

  1. Ah, great idea - will do it all in the same script!
  2. Nope, the second script is using using the Hipchat API and posting the URL to one of the rooms - so I need the URL to use as the message content. Any ideas?
  3. Large type is just example, and to show what is being outputted from the second script. What I'd love to do is pass exactly what I copy through to the keyboard - through to the second script, which must run after the first script. Thanks Shawn
  4. Hi everyone! So apologies if this is a crazy question, but I'm having a little trouble understanding how to pass data between scripts. In my first php script, I successfully copy a url to the clipboard (that works great). What I'd like to do now is pass that url onto the second PHP script so I can use it in another way. 1. I'm not quite sure how to have the second script run AFTER the first one. 2. I'm not sure what variable to use to pass the output on, I know it's not {query}, but is there something similar?
  5. Quick one though Shawn, I'd like to add a second script that runs AFTER the first one, not in parallel, but I can't seem to link them? https://www.dropbox.com/s/illgm1nobiam2rd/Screenshot%202014-08-05%2020.20.40.png Any tips?
  6. Worked really well Shawn, THANK YOU! Next step is to write a script that posts the image into a Hipchat room "One step at a time"
  7. So I have the following PHP script which works well. I'm a newbie here, but trying to create a workflow where I can enter an argument, and it pings google, and returns the top result URL to me, copied to my clipboard. Like I said, on the last line, I do successfully return the top result, but not entirely sure how to hook up the rest of the workflow. Here you can see the workflow at the moment -> https://www.dropbox.com/s/pfo7b0uap41bd0g/Screenshot%202014-08-05%2016.13.02.png Any help would be much appreciated! function get_url_contents($url) { $crl = curl_init(); curl_setopt($crl, CURLOPT_USERAGENT, 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322)'); curl_setopt($crl, CURLOPT_URL, $url); curl_setopt($crl, CURLOPT_RETURNTRANSFER, 1); curl_setopt($crl, CURLOPT_CONNECTTIMEOUT, 5); $ret = curl_exec($crl); curl_close($crl); return $ret; } $q = $argv[1]; //Get user-inputted argument $json = get_url_contents('http://ajax.googleapis.com/ajax/services/search/images?v=1.0&q=.$q.'); $data = json_decode($json); foreach ($data->responseData->results as $result) { $results[] = array('url' => $result->url, 'alt' => $result->title); } $url = $results[0]['url']; echo $url;
×
×
  • Create New...