Closed (fixed)
Project:
Amplify
Version:
6.x-1.2
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Reporter:
Created:
25 Sep 2009 at 00:19 UTC
Updated:
27 Jul 2011 at 07:52 UTC
Hi Matt
I've tried to look into the code for your module and found amplify_get_proper_nouns, but this picks up the whole node, and it's not clear to me if I can use amplify_get_qp for just passing a URL for openamplify to analyse.
So, how can I code a request to openamplify to take a node field as the 'sourceurl', perform its analysis, and then populate another node field with its response?
Am I clutching at straws here?
Any pointers to get me started would be appreciated,
best wishes
scotjam
Comments
Comment #1
mbutcher commentedSo you want to have the module analyze the contents of a URL? I'd be more than happy to add a function to do that. I've been sitting on a release for a while, too, since the minor bugs I've fixed haven't been enough to justify a full release.
Matt
Comment #2
scotjam commentedSubmitting a URL to openamplify via your module would be ideal. The output would ideally be populated into another field of the same node that provided the URL to be analysed. Hope I'm not asking for too much here?
If this is easy to do :) then a future feature request would be to allow someone to specify what results to get back and to specify multiple node fields as destinations for the openamplify results.
best wishes
scotjam
Comment #3
scotjam commentedHi Matt
Any further thoughts on how your module might analyse a link field?
I'm interested to here what you think would work best.
best wishes
scotjam
Comment #4
mbutcher commentedI added a new function call,
amplify_amplify_url($url), that will run the analysis and return a QueryPath object wrapping the results.There is an example of this in amplify.admin.inc.
So... if you wanted a custom module that read the CCK link field from a node, and then stored the results of the amplification in a CCK textarea, you would do something like this:
At that point, you'd have the XML in your database, stored as a CCK field. At any time, you could retrieve it and load it back into QueryPath:
Comment #5
scotjam commentedHi Matt,
Thanks for this. Trying it out, but occasionally getting error messages of the following sorts...
1. "No suitable nodes are available to serve your request"
and
2. "Could not amplify the document. The remote server did not return the expected data."
Can you kindly clarify what would cause such error messages while requesting amplify to amplify a url and what can be done to fix it?
best wishes
scotjam
Comment #6
scotjam commentedAn update...
Found this.. titled 'Why is my request failing' on openamplify's site...
http://community.openamplify.com/forums/p/210/281.aspx#281
But no mention of the above two errors which I guess originate from the module.
cheers
scotjam
Comment #7
scotjam commentedI've found out that the first error message '"No suitable nodes are available to serve your request"' is from the load balancers as they are timing out waiting for a response, which might explain the second error message 'Could not amplify the document. The remote server did not return the expected data.'
Hope this helps.
best wishes
scotjam
Comment #8
arpieb commentedThe Could not amplify the document. The remote server did not return the expected data error should be resolved with the updates committed to the 6.x-1.x-dev branch tonight, reported in #988758: No data returned.
Otherwise it looks like the amplify_amplify_url function added by @mbutcher covers the bases for the URL-based OpenAmplify query for this ticket as the other error was network-induced.
Marking as "fixed" for now - if nobody reopens it we should be good to go...