Changing blog information (such as blog title) using Google Blogger API - php

I'm using the v1.0 PHP API, but an answer for any of the languages/versions will suffice (I'll be able to figure it out in PHP.)
Google's Blogger API shows the ability to perform CRUD operations, but nothing else.
Is it possible to change any blog preferences/settings/options, specifically something like changing the blog title via API?
I haven't seen anything in my searches, but it seems like something that should be available.

It seems that it might be possible (can't try it right now) by using the GData API - for a reference see esp. the updating an entry part at https://code.google.com/apis/gdata/docs/2.0/basics.html
You need to combine that with the description here (which is/does exactly what you are asking for) and the URL you got for an answer (i.e. https://www.blogger.com/feeds/*[blogId]*/settings) although that answer seems to indicate it is not possible right now. Since these are contradicting each other I would definitely give it a try.

The answer is no. After looking through the 2.0 protocol documentation it's clear that you can only interact with blog posts and comments, not with the blog's metadata.
As for the answer you got at the Blogger dev group, the person seems to be saying it's possible to retrieve the current title, but it's not possible to change it.

Related

Not getting videos from youtube api

I am new to android and php and working on old project.
Everything worked smoothly till yesterday. I am getting all videos from you tube api:
https://gdata.youtube.com/feeds/api/videos?q=&start-index=1&max-results=10&v=2&alt=json
But from today, i just get only one video from this link and that is:
https://support.google.com/youtube/answer/6098135?p=yt_devicesupport&hl=en&rd=1
I have read that v2 become depreciated so i need to move to v3 version ?
I need help on how to get all videos as before.
There isn't really an easy answer for this. At least, we can't really just give you a new address to plop in the place of the old one. API v3 is structured differently and has different requirements than v2. Some of those changes at least theoretically bring some performance advantages, but when requesting things from this new API, you need to be more specific about what you're looking for. Also, since some of the data has moved around within the JSON results, you may need to change where your code looks for given information.
As it is, I don't really know what information you need, or for that matter, what collection of videos you're looking for. In this version of the API, these details actually matter. In v3, you have to provide a comma-separated list of the information you're looking for, and then at least one more "filter" parameter as well (filters, for your cases are probably either "chart" which is something like the "chart of the most popular", or "id" which is a comma-separated list of video IDs.)
While it's probably not the answer you were looking for, you probably need to stroll through the documentation. I especially suggest the Try It section, where you can plug in your parameters and build the query.
You'll need an API key to use the new API, and you can get that key from the Google Developers console. Create a new project, and add the YouTube API to it.

Php Rest API path hierarchy w/o id

I am reading a book and searching on the internet about this API path hirearchy and have not found anything solid yet, what I really want to know is where to put the id to retrieve/update/delete hirearchical API methods.
For instance I know I can do:
authority/resource/[id]/catalog/category1/category2
also:
authority/resource/catalog/category1/category2/[id]
in this previous example the problem comes when the next path from category2 (id) can be a numeric field to lets say update a value.
I do not really know if there is a standard about this way of building an state transfer API.
I can actually build my own and I was wondering if there are any standards or some aproach.
The "standard" allows lot's of interpretations on how you can design your hierarchy. There is not really THE way to do it.
However I think that this presentation:
https://blog.apigee.com/detail/restful_api_design
Is a good read on the topic. It outlines some design choices and also shows how some popular APIs (such as the ones offered by Google or Twitter) choose to design their URLs.

Intense Debate PHP Class?

I'm working with Intense Debate. I keep looking for a way to integrate a non-javascript version in my websites… and I was hoping there would be some sort of PHP Class available but I can not find one on google, and the API they provide is a Javascript API for customization.
What I want to do is use Intensedebate like wordpress does but in my own script. They said this in their FAQ on SEO:
IntenseDebate outputs the standard WordPress comments enabling your comments to still be indexed by search engines that ignore JavaScript, while ensuring that visitors surfing with JavaScript disabled will be able to interact with comments made in IntenseDebate. Readers with JS disabled can comment in the original WP system and those comments will be imported into ID.
That is actually what I am trying to achieve with my own custom PHP script. But there is no documentation on this…
You can see what I mean on my temporary test page: http://repost.be/index.php
As you can see when you disable javascript… you can't see the comments, nor comment.
That is by the way just an HTML page with custom Javascript that Intensedebate provided.
Any thoughts on how I can interact with their API properly or find a PHP class that does so?
I'm not familiar with IntenseDebate, but from what I can gather from their help docs and general comments on the net, their system absolutely requires Javascript to run. There's no way to use their data through another API.
Apparently IntenseDebate gives WP users the option to sync their comments with IntenseDebate through the provided Wordpress plugin. Maybe you

Is this RESTful? Using Tonic

I'm trying to create a REST service which shows/adds/deletes/edits soccer data in a database.
I've made a design of how I could achieve this, but it becomes quite complicated.
For example, when a goal is scored, what URL should I call?
So the question is, am I going in the right direction or do you advice something way different?
I agree with Abhiniav's answer except on the fact that PUT should not always be used for editing. It should only be used when you are sending the new complete resource. If you are sending a modification or partial, use POST, or the lesser known PATCH.
Reading up on Safe and Idempotent methods should be useful.
You would most likely use POST or PATCH to update the goal count: /{country}/team/{team_id}/goals.
The biggest reason something isn't REST is because services are not discoverable. Read up on HATEOAS.
Everything seems fine in your structure except that you should switch PUT and POST.
PUT can be used for both updating/creating records. In case you know the resource ID before hand, you can use PUT.
POST is used when you would be creating new resources whose IDs you would not know.
Stackoverflow has a pretty detailed discussion here:
PUT vs POST in REST

Search MySpace by keyword using PHP class

I've come across several tools that search users by keyword, however, none that's open source.
I'm not familiar with the MySpace API and at first glance it doesn't seem like this option is available. I was hoping a PHP class exists for this sort of thing. So my question: how do I identify myspace users that have a keyword? Can it done through the API or another route is needed?
I haven't looked at the API, but I would say if you can't find a search function in the API, your best bet would be to write a scraper.
Use PHP (you may need curl as well) to load the MySpace search page with your query. Then parse the source code of that page to find what you want.
If you can't find a keyword lookup in the API, and you can't do a keyword lookup/search through the website, you're unfortunately likely out of luck.
In case it's useful now, better late than never?
They've opened up their API in the latest version allowing searching for a person by search term. See this as an example:
http://api.myspace.com/opensearch/people?searchTerms=ferrari&format=xml

Categories