Looking for web service that download a webpage (we'll provide the URL), normalize it (gets XHTML) and applies XSLT (which sits on another URL we provide). Must support JSONP style result.
Could anyone suggest something?
Yahoo YQL is the answer: http://developer.yahoo.com/yql/.
Related
I am fairly new to web API and i'm currently following this tutorial
I have only got as far as task 3 and i'm quite learning a lot.
As you can see the tutorial is using Internet Explorer and I am using Chrome .. for some reason Chrome is returning xml and IE is returning a json object. Should I worry about this or not? i'd love it if Chrome returned a Json object though..
Thank you
WebApi is pretty cool in that it will serialise it's output as JSON or XML based on the accept header sent by the browser.
I expect that Chrome's default is XML, and IE's is JSON.
I can't find a simple configuration change example for Chrome, with most information pointing to having to use a plugin to change the accept header. In Firefox the default is XML but you can adjust it with a config change.
My situation: I'm working on a web monitoring dashboard that assembles informations from different applications and sources and generate graphs, info graphics and reports.
The applications I'm trying to integrate are CACTI, Nagios, and other local private monitoring tools. I had no problem to integrate these applications, except for Nagios (I don't have much experience with it).
What I want to know is if there is a way to use Nagios as a Web Service, or something similar, so I can expose some of the informations and use it to generate my own reports on my dashboard application.
Is it possible to do that without any epic effort?
thanks for reading.
Nagios 4.x starting with version 4.4 now includes CGIs for JSON output. Installing the newest version of Nagios might be the easiest way to go.
See the announcement here.
Review the slides from Nagios World Conference 2013 here.
The Check_MK Multisite GUI (Web base GUI using MK Livestatus) offers a web service mode, where you can send queries/commands as URL parameters and get the response as JSON in the body.
The trick is: Create a view in the GUI, which fits your needs. Then extract the URL of that view and add the parameter output_format=json. Now you should have the output in a parsable format.
For example, this URL should give you a JSON list of all services:
check_mk/view.py?view_name=allservices&output_format=json
You can try:
1) MK Livestatus http://mathias-kettner.de/checkmk_livestatus.html
it's not web service but it can give current data without any complicated action. All you need redirect this data.
2)status-json plugin http://exchange.nagios.org/directory/Addons/APIs/JSON/status-2Djson/details which return data in JSON format.
3)NagiosWS plugin but I wasn't able to get to work it yet. I think it can be done for Nagios 2.x
4)GroundWork Foundation plugin. I think I will try use it now.
I was able to get to work 1 and 2 solution now.
Otherwise you can use Icinga which can give you some JSON or XML output. Icinga is fork of Nagios and can be installed with saving all your nagios data and plugins. At least it written on Icinga's site =) They have some other solution like PHP lib.
Sorry, I cannot post only 2 link while I'm newbie on this site.
Best regards.
Worked for me - MK Livestatus http://mathias-kettner.de/checkmk_livestatus.html it's not web service but it can give current data without any complicated action. All you need redirect this data.
I would like to use Foursquare API XML results and transform them using XSLT to a RSS feed. I was wondering if there's any web site that has that functionality and generates a URL that returns the final transformation.
Something like:
From URL: http://foursquare.com/myapicall + XSLT transformation
I get a new URL: http://transformer/url=http://server.com/myapiresult&xlst=XXX
that returns the resulting transformation
Any other ideas to achieve this are welcome!
Thanks a lot
The W3C hosts an XSLT 2.0 Online XSLT Servlet Service that can be used to transform files.
http://www.w3.org/2005/08/online_xslt
In addition to using the form, you can also invoke the XSLT servlet by formulating a URL with two querystring parameters: 1. xmlfile to specify the source XML and 2. xslfile the XSLT to apply:
The results of the transform are returned from the request to the URL.
For example:
http://www.w3.org/2005/08/online_xslt/xslt?xmlfile=http://rss.cnn.com/rss/cnn_topstories.rss&xslfile=http://interglacial.com/rss/smb_rss2html.xsl
Conditions for Use
This service is provided without
warranty.
This service is freely (show your
support) provided for interactive use
by individuals only and not to be
utilized as a regular service by sites
other than w3.org. We will consider
blocking high volume usage or any
usage that causes a strain on our Web
servers.
Abuses of this service will be
deterred, please report any incidents.
To deter this service being utilized
by spammers, SURBL is implemented.
You may also wish to install the
application locally rather than using
the W3C service. For your convenience
a compiled version of this servlet and
the org.w3c classes used are collected
into a jar.
Not sure what exactly you are looking for, but these sites offer online XSLT transformations, showing the results in the browser:
http://www.w3schools.com/xsl/tryxslt.asp?xmlfile=cdcatalog&xsltfile=cdcatalog
http://chris.photobooks.com/xml/default.htm
I was wondering if there's any web
site that has that functionality and
generates a URL that returns the final
transformation.
While there may be sites that offer such functionality, this is by definition limited to a certain XSLT processor and comes with limited functionality (for example it is likely that DTDs and functions as document() are not supported, as well as EXSLT and other useful libraries).
Also, do not expect such sites to be responsive, as it is extremely easy to suffocate any such site -- just commit an error that results in endless recursion.
Therefore, I recommend getting a good XSLT processor and performing the transformation on your own computer.
See my answer to this question for available free XSLT processors and environments.
How can I get Google search results from inside a program? I need to get an array of search results for a specified string.
C++ requires a little more work then other languages. You will need to connect to Google's REST Search API and then use a JSON parser to parse out the search results. Json.org has a collection of JSON parsers in various languages.
Use their javascript search API http://code.google.com/apis/ajaxsearch/
They no longer support their SOAP search api unfortunately
So... nine years later, you can no longer do that. You do get JSON, but it's quite short and just says "The Google Web Search API is no longer available. Please migrate to the Google Custom Search API (https://developers.google.com/custom-search/)"
Google Custom Search can search the entire web using the 'Thing' schema.org topic. https://support.google.com/customsearch/answer/4513886?visit_id=636769478248533420-865620074&rd=1
Google offers Ajax API for JavaScript programmers and a poor documentation for Python, PHP and Flash.By the way, If you are able to connect to remote http server with any other c++ library, you can do it. just change the url you are using and point it to: http://ajax.googleapis.com/ajax/services/search/web?v=1.0&q={My_CPP_Query}
You will get JSON data stream, that you will be able to work with.
i remember i saw youtube tutorial on doing that, not sure about the library name but its something like _NT_SEARCH_GH:etcetcetcetcetcetc;
I'd like to build an application using smartgwt and web2py.
I am new to both.
Ultimately what I would like to do is display objects obtained from a web2py backend in a smartgwt TileGrid.
Can anyone enumerate the broad strokes of what needs to be done? Or point me to any useful resources?
Any information that would apply more to django is also welcome.
download smartgwt (excellent framework by the way) and look into this example:
file://localhost/Users/massimodipierro/Desktop/smartgwt-1.0b1/samples/Showcase/www/com.smartgwt.sample.showcase.Showcase/index.html#tiling_load_on_deamnd
which displays images in a tilegrid. The images are received from Yahoo via an http request. The response is in JSON. Look into the source code. To see the json response from Yahoo try the following URL:
http://api.search.yahoo.com/ImageSearchService/V1/imageSearch?appid=YahooDemo&output=json&query=snowboard
To make this work with web2py you need to replace that URL with the URL of a web2py action that returns a similar JSON response.
I do not know much about smartgwt but I am sure on the web2py google groups there are people willing to help.
Have a look at this tutorial on using web2py with Pajamas, which is another library built on GWT.