OneNote API - Get Raw XML - rest

Using OneNote's Onetastic I've been able to inspect the raw XML structure of the notebooks. The REST API returns the page information as HTML, but is limited (no support for ink, shapes, OCR, etc.)
Is there some way to get the raw XML of the page? Perhaps from the OneDrive API?
Thanks in advance!

Unfortunately, there isn't. You can only get HTML.
I do encourage you to go into our uservoice site and create requests for whetever type of content we don't support:
https://onenote.uservoice.com/forums/245490-onenote-developer-apis
For example, there is one for ink.
https://onenote.uservoice.com/forums/245490-onenote-developer-apis/suggestions/5657688-ink-support-in-the-api

Related

How do I define an edit page within a REST API?

In a Play app I'm designing, these are some of my routes
POST /visits controllers.Visit.create
GET /visits controllers.Visit.visits
GET /visits/:id controllers.Visit.visit(id: Long)
PUT /visits/:id controllers.Visit.update(id: Long)
DELETE /visits/:id controllers.Visit.delete(id: Long)
I'm supporting a browser interface too. I'm following with the guidance I saw here:
RESTful on Play! framework
I can easily provide an HTML template to display detailed information about one specific visit, or a list of visits. But how does an "edit page" fall cleanly into this, which would have to be prefilled with the information from a particular visit? I can easily do something like: GET /visits/:id/edit controllers.Visit.edit(id: Long) which would return a prefilled page with the visit information, or I can have a static HTML page which calls the /visits/:id with an AJAX call to populate the fields, and this would let me avoid corrupting my resource-driven API with a browser page-specific route. Or is there some better option? What is best practice and why?
In REST it doesn't make sense for you to create additional resources simply to perform standardized actions. Everyone who knows the HTTP protocol knows your visit object should be editable through a PATCH request with the diff you want to be applied, or through a PUT request that replaces the whole resource with a new one. Why create a custom and non-standard edit action with POST, that you will have to document and explain to everyone how it works?
In that sense, I'd say your best option is having a static HTML page that drives your API, using a GET on /visits/:id to populate the fields, and use the edited content to replace /visits/:id with a PUT when submitted.
However, keep in mind that there's nothing wrong with having a browser page-specific route in your API, as long as you're respecting the Accept header sent by the client. On my APIs, I sometimes have some routes returning a human friendly representation of the resource when the request is made using the Accept: text/html header, so it's a simple way to have a builtin admin client and the API can be easily explored with a browser. In REST, the only difference between an API and a WEB page is that the first returns a representation in a machine-friendly format, and the second a representation that you expect to be rendered by a browser in a human-friendly document. Both of them are supposed to have the links and/or forms with directions on how to edit the resource.

Wikipedia page parser for iPhone App project

i want parse a wikipedia page to retrieve information for my ios app, there is a parser or some tutorial that explain me how i can do it?...or to put the page in an xml format, i have look the http://www.mediawiki.org/wiki/MediaWiki page, but i haven't understood nothing, if anyone can help me please..maybe with some example...
Have you read the MediaWiki API page, the page that describes the Query action, and above all else their API FAQ? These links will tell you what URLs you should be using to get the data that you require.
Do you know how to download a URL with NSURLConnection?
To start with, try using their API to download a Wikipedia page of your choice in HTML format. There's an answer in their FAQ that tells you how to request HTML format. If you do that, you'll get something you could display in a web view and style as you'd like.

Facebook Graph API SEO Comments and Profanity Filter

I'm trying to integrate the Facebook comments left on our site in a way in which the content can be crawled by search engines and also for people (although I highly doubt there will be many) who don't have Javascript enabled on their browser.
Currently our Facebook comments are displayed via the use of the Facebook comment social plugin (using the <fb:comments href="MY_URL" num_posts="50" width="665"></fb:comments> tag). This ends up rendering an iFrame (which are mostly ignored by search engine crawlers) so the plan is to render this information and format it with basic HTML. To do this, the comments are pulled using the Graph API - this is then only be displayed to crawlers and people with Javascript disabled.
This all works nicely using the Graph API call (https://graph.facebook.com/comments/?ids=MY_URL), parsing the JSON result and displaying it on the page. The problem is that the <fb:comments> approach filters our results based on a blacklist we have set up on one of our Facebook Apps. The AppId with the relevant blacklist is stored on the page using metadata (<meta property="fb:app_id" content="APP_ID"/>) which the <fb:comments> control obviously must somehow use to filter the comments.
The problem is the Graph API method does not filter any results as I guess no blacklist (or App Id containing a blacklist) is specified. Does anyone know how to specify a Facebook App ID to the API call URL or of another way to not fetch commnents back that violate the terms of the blacklist?
On a side note, I know the debate about filtering content in comments rages on but it is a management decision to implement the blacklist, and one that I have no influence in changing - just incase anyone felt the need to explain the reasons why content filtering is or isn't a good idea!
Any thoughts on a solution?
Unfortunately there's no way to access a filtered list of comments using the API - it might be a reasonably request to have this in the API - you should file a wishlist item in Facebook's bug tracker
Otherwise, the only solution I can think of is to implement your own filter on your side when retrieving and displaying the comments from the API.
According to the Comments plugin documentation the filter on Facebook's side is implemented as a simple substring match, so it should be trivial to implement.
A fairly simple regular expression match should be able to check each comment against a relatively long list quickly.
(Unfortunately, the tradeoff here is that implementing a filter is easy, but you'd also need to write an interface so that whoever's updating the list of disallowed words can maintain the list for both the Facebook plugin, and your own filtering.)
Quote from docs:
The comment is checked via substring matching. This means if you blacklist the
word 'at', if the comment contains the sequence 'a' 't' anywhere it will be
marked with limited visibility; e.g. if the comment contained the words 'bat',
'hat', 'attend', etc it would be caught.
Pretty sure there is no current way of doing this from the graph API, the only thing I can suggest is taking the blacklist and build your own filter

How to set content type to html on Google Calendar api?

So reading the google calendar api (php) documentation it states:
"...content, set using setContent, provides additional information about the event which appears when the event details are requested from within Google Calendar. Optionally, the description's mime-type is set using setType to specify HTML instead of plain text. "
I've been trying to figure this out for a really long time but i have no idea how to go about setting the content to html instead of plan text. I tried using the setType method, on Zend_Gdata_Calendar object, but it said the method doesn't exist. Any ideas?
In the API there is a section that talks about "Creating web content events." That shows an example of setting the type, which is just a MIME type. For HTML, you can set the type as "text/html" and then provide the link to the HTML.
Data API Developer's Guide: PHP
From reading it, I believe this will create an iFrame that shows your content. I've been playing around with this a lot in .NET and it seems to work. I hope this helps you.

Google feed api integration with iPhone/Objective C

I am building an RSS Reader. Some of the existing ones out there (for example, Pulse News for iPhone/iPad) have a search box where you can search for some term (example - "sports") and it will return a list of feeds that match your search criteria. So in this example, you type in "sports", and it searches and then comes back with ESPN.com's news feed, Yahoo! Sports' news feed, etc. etc.
After initial research, I found out that Google feed API does the same.
https://code.google.com/intl/fr/apis/ajaxfeeds/documentation/reference.html#findFeeds
However, I cant figure out how to use the google feed api. It returns the xml that i need to parse but the part I am confused is how to call the API and where to catch the xml response. Can some one post a tutorial or some help on how to integrate it.
Found a suitable solution with "Google Feed API" itself. They also have a JSON API(wow!!) which returns the JSON file for any query fired..
Here is the link:
https://ajax.googleapis.com/ajax/services/feed/find?v=1.0&q=
e.g:
https://ajax.googleapis.com/ajax/services/feed/find?v=1.0&q=News