Note that there are some explanatory texts on larger screens.

plurals
  1. POWhen Accessing OpenAmplify from QueryPath my HTTP request fails/times out. Why?
    primarykey
    data
    text
    <p>WHen I run this script from cmd.exe [command line] on WAMP I get:</p> <pre><code> Could not retrieve data from OpenAmplify.file_get_contents(http://portal tnx.openamplify.com/AmplifyWeb/AmplifyThis?apiKey=MY_API_KEY_GOES_HERE): failed to open stream: HTTP request failed! (C:\wamp\www\Learning_Query_Pa th\src\QueryPath\QueryPath.php: 4053) </code></pre> <p>When I run this script from localhost via firefox browser [v 19.0] I get:</p> <pre><code>Fatal error: Maximum execution time of 30 seconds exceeded in C:\wamp\www\Learning_Query_Path\src\QueryPath\QueryPath.php on line 4525 </code></pre> <p>Here is the script I used:</p> <pre><code> &lt;?php require 'src/QueryPath/QueryPath.php'; $url = 'http://portaltnx.openamplify.com/AmplifyWeb/AmplifyThis?'; $key = 'I_PUT_MY_API_KEY_HERE'; $text = 'I_PUT_TEXT_HERE'; $params = array( 'apiKey' =&gt; $key, ); $url .= http_build_query($params); $options = array( 'http' =&gt; array( 'method' =&gt; 'POST', 'user_agent' =&gt; 'QueryPath/2.0', 'header' =&gt; 'Content-type: application/x-www-form-url-encoded', 'content' =&gt; http_build_query(array('inputText' =&gt; $text)), ), ); $context = stream_context_create($options); try { $qp = qp($url, NULL, array('context' =&gt; $context)); } catch (Exception $e) { print "Could not retrieve data from OpenAmplify." . $e-&gt;getMessage(); exit; } $qp-&gt;find('ProperNouns&gt;TopicResult&gt;Topic&gt;Name')-&gt;slice(0, 20); $out = qp(QueryPath::HTML_STUB, 'body')-&gt;append('&lt;ul/&gt;')-&gt;find('ul'); foreach ($qp as $name) { $out-&gt;append('&lt;li&gt;' . $name-&gt;text() . '&lt;/li&gt;'); } $out-&gt;writeHTML(); ?&gt; </code></pre> <p>How can I make this work?</p> <p>P.S. Open Amplify is a web service which takes the text provided and after analysing it, returns alot of interesting things about it. I am really keen on making this work and big fan of QueryPath, so I am only interested in suggestions on how to make it work with QueryPath!</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload