Post XMl data to a webservice via YQL - web-services

I have a vendor, that i need to post XML data to their Webservice that will give me a response which will get displayed via Javascript in the tabular format.
I was using xmlhttp object or Ajax, but that will result me in getting Cross site scripting alert box in IE.
So i thought i will use YQL , but nowhere i could find a way to post data to the webservices via YQL. are there any examples. is this possible?
I even tried "Select * from http://stagingimport.brassring.com/WebRouter/WebRouter.asmx/route where Query = ...". this webservice does not accept JSON data.
Or are there any similar things like YQL that will do that.
I am using SharePoint and would not want to go through server side solution , as this is a temporary solution of what we are trying to achieve.
I am going to this URL http://stagingimport.brassring.com/WebRouter/WebRouter.asmx/route that is a webservice and requires xml data send them via post.
I would appreciate your input.
Thanks
Rahul

Alright guys,
i think i found it.
The answer is Yes, you can do it. i opened up a Yahoo console and wrote something like
select * from xml where url='http://import.brassring.com/WebRouter/WebRouter.asmx/route?inputXml=%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22iso-8859- .........
and it did return me the record, although it was not JSON as they only return XML inside an XML.
Today I also tried ql.io from Ebay and I was also able to get the expected return value.
Hope it will help someone, Can't give the whole code as stated above as it is authenticated.

Related

How to connect Rally API (python) to the specific reports under 'Report' section

I have been working on developing a Rally API using python with the help of links pointed by Rally help (Pyral). My code connects well with the Rally server and pulls specific user story I want, but not the columns I am interested in. I am aiming to pull [full] specific reports with fields such as project, tags, etc. under the 'Reports' tab. I tried to find out how can I do it but didn't get direction. Also, the specific user stories I am able to pull include some weird fields like c_name, c_offer and the like. I would really appreciate if someone could help me through this. Like to connect to a specific project/workspace in Rally we have the following code where it asks the details in the manner below:
rally = Rally(server='', apikey='',workspace='',project='')
Is there any way to specify what report/columns I want?
Thanks in advance
Most of the reports on the Reports tab are rendered by a separate Analytics 1 service outside of the standard WSAPI you've been communicating with. Some of that data is available in WSAPI -IterationCumulativeFlowData, ReleaseCumulativeFlowData. What data specifically are you looking for?

List of countries and cities to be used in Facebook Graph API for targeting

I am looking for a list of countries/states/cities that can be used with Facebook Graph API when publishing targeted posts.
I found one JSON file available on this page but the file doesn't parse correctly and I also doubt whether it can be used for post targeting since the file is for advertisements.
Also, I am not sure whether the third party data like the one provided by MaxMind can be used directly with Facebook API.
Does anyone have such a list or can atleast point me to a right direction?
The answer is here: https://developers.facebook.com/docs/reference/ads-api/get-autocomplete-data/
To check what countries are available you could just get a response from this endpoint:
URL:
https://graph.facebook.com/API_VERSION/search?type=adgeolocation&location_types=['country']
HTTP_METHOD: GET
You also have to set your access token in the URL.
To just see the fields key and name and a larger quantity of countries without being paginated this would be the complete URL:
https://graph.facebook.com/API_VERSION/search?type=adgeolocation&location_types=['country']&fields=key,name&limit=1000
For countries: search?type=adgeolocation&location_types=['countries']&limit=1000
For regions: search?type=adgeolocation&location_types=['region']&limit=1000&country_code=PT
Hope that helps :)
Well, for countries you could always check the Facebook Internationalization Document.
The file Facebook publishes seems valid for city/state/country lookups. It provides the graph id you will need. And it seems to parse as valid json for me.
Ok. I was able to use the same JSON file I mentioned in my question. As I said in my response to #offbysome, previously I had saved the file by opening it in Google Chrome. But then I used Firefox and used the Right Click => Save File As option to save the file on disk. This file is actually a tar gz (which facebook wrongly names as .php file). After unzipping the file, I was able to use the same code posted in my comment to get the PHP array which I then imported to MySQL.

drupal: how to post a comment through services API?

I am currently developping a mobile application with a drupal 7 website as a backend. Using the services API with a REST server I was able to easily access the nodes, users, files and comments to see their content.
I am able via a POST request to log in the website but I cannot create a comment through the services API. Actually, there is no error and a new comment is well created in the database but it is empty and its nid is 0.
I also tried to download a valid comment, modify it with new datas, and send it but I have the same result.
I also need to add that the comments I am using or not just simple ones, they include some specific fields in their form.
Can anyone help me to solve this problem ? Has anyone ever experience something similar ?
Thank you
Check you are posting an object that is correctly structured, services isn't doing a comment_save()
Have a look at the test scripts for the structure
http://drupalcode.org/project/services.git/blob/refs/heads/7.x-3.x:/tests/functional/ServicesResourceCommentTests.test#l100

using POST request on Facebook Graph API

I want to access graph API to get the number of shares for different pages of my website. I can use the GET method to do so but I want to use POST so that I can send more url in a single request. The current implementation I have for GET is
http://graph.facebook.com/?ids=http://umairj.com/,http://umairj.com/146/how-to-clear-facebook-shares-cache/
Can anyone please help ?
This is badly documented (I mean I didn't find the information when I looked for it!), but there is way to pass all the parameters to the Graph API through POST method:
in your example, you should POST to http://graph.facebook.com/
with the following DATA:
ids=http://umairj.com/,http://umairj.com/146/how-to-clear-facebook-shares-cache/&method=GET
I'm not sure about the encoding of the POST DATA..in our case, we were just using ids=.....,.....,..... with numeric FB user ids and we didn't need to do any encoding, but you might need some url-encoding
Don't forget the &method=GET or it won't work ! It helped me break the url length limit that was causing bugs on Internet Explorer (I think RFC says 1024 characters, all browsers support much more, IE only ~4096 ) when we were passing too many ids through GET
if you wish to access non-public information, the same trick works with https://graph.facebook.com/ , provided you add &session_token=***** to your query
You can try to run a FQL query to get the stats for multiple urls. Facebook link_stat documentation has an example of how to do this. I'm pretty sure you can't POST to either the FQL query or the graph api you were using though unfortunately. Your FQL query would be:
SELECT url, share_count, like_count FROM link_stat WHERE url IN("http://umairj.com/","http://umairj.com/146/how-to-clear-facebook-shares-cache/")
Here is the url after properly url encoding the query: https://api.facebook.com/method/fql.query?query=SELECT+url%2C+share_count%2C+like_count+FROM+link_stat+WHERE+url+IN%28"http%3A%2F%2Fumairj.com%2F"%2C"http%3A%2F%2Fumairj.com%2F146%2Fhow-to-clear-facebook-shares-cache%2F"%29&format=json
Facebook provides a FQL testing tool to help.
Update: their API documention (see section titled "Delete) mentions you can do an HTTP POST to any of their methods and set the variable method to the method you want. You could try this, although this was designed for delete and put methods not available to javascript clients. It still looks like is all url based so I'm not sure it will take a form encoded parameter like you are looking to do.
I work at Facebook and I've updated our Graph API documentation to document this work around for very large requests:
https://developers.facebook.com/docs/graph-api/using-graph-api#largerequests

Is there a Web Service API to the Google Product Search?

I want to call the Google product search and get back a parse-able XML file rather than having to scrape the HTML. I'm not looking for a SOAP based service, but a service that returns XML based on a URL passed in.
Correction--this did NOT work:
The Google Base API lists only a subset of Google product sellers (apparently only those who are active users of the Google Base product.)
http://code.google.com/apis/base/docs/2.0/attrs-queries.html
I eventually ended up using a screen scraping solution and then found that the data was too inconsistant to use for my purposes at all. :-(
http://answers.oreilly.com/topic/2165-how-to-search-google-and-bing-in-c/
use that refer link ,hopefuly it'll very usefull with you all guys