RESTFul web service URL style - web-services

Is the difference between having url parameters passed as
http://myserver/someoperation/bob/sally
versus
http://myserver/someoperation?arg1=bob&arg2=sally
purely up to user preference or are there good reasons for each?
I have a web service that is using the first style, but I am wondering if I am missing part of the equation.

As far as search engine optimization goes, Google has stated:
If your URL contains relevant words, this provides users and search engines with more information about the page than an ID or oddly named parameter would.
That seems to imply that having pages where your URLs have meaningful information would give your page a better ranking although they don't outright say that.
You can read more on their full guide: Google Search Engine Optimization Starter Guide (PDF). That quote was from page 8.

Related

Google Analytics and cookies

My question is: I'm developing a website and I want to monitor analytics with Google Analytics, however I've been reading articles about cookies and I didn't realize if I need to program my website with some kind of cookies in order to use google tool, or if I simply don't need to do anything on my website.
Thanks
To do tracking you simply need to insert the code snippet that you can get from the GA admin interface.
However since you are in the EU you need to point out to your visitors that they are being tracked on your web page and that the site uses cookies to do so (and I think you need to provide an opt-out, although that might be a German thing). This is mandated by the European Privacy directive, which is sometimes referred to as "Cookie Law" (technically incorrect, since it is neither a law nor specifically about cookies), so maybe this gave you the idea that you need to do extra programming.

Cookiewall and content cloaking

To comply with the European cookie law, we should implement cookie wall. But search engines should be able to see and index actual page content not cookie wall.
Searching online I found that many people recommend checking user-agent and feeding actual content for bots and crawlers and show cookie wall for real users. Popular WordPress Cookie wall plugins also implement this way by checking bots & crawlers/real users
My question is: Does google count this as content cloaking and penalize SEO ranking or not? Or is there another way to implement cookie wall without affecting SEO ranking
Cloaking is a search engine optimization (SEO) technique in which the content presented to the search engine spider is different from that presented to the user's browser. This is done by delivering content based on the IP addresses or the User-Agent HTTP header of the user requesting the page.
Cloaking takes a user to other sites than he or she expects by disguising those sites' true content. During cloaking, the search engine spider and the browser are presented with different content for the same Web page. HTTP header information or IP addresses assist in sending the wrong Web pages. Searchers will then access websites that contain information they simply were not seeking, including pornographic sites. Website directories also offer up their share of cloaking techniques.
Many of the larger search engine companies oppose cloaking because it frustrates their users and does not comply with their standards. In the search engine optimization (SEO) industry, cloaking is considered to be a black hat technique that, while used, is frowned on by most legitimate SEO firms and Web publishers. Getting caught cloaking can result in huge penalties from the search engines, including being removed from the index altogether.
So, yeah, this count as cloacking.
Put the cookie disclaimer in an <aside> element. Make sure you initialise this with some internet explorer js code as it's HTML5 only. Google will generally ignore these based on their content, position and it's relevance to the rest of the page.

How would REST handle post-processing / including relevant resources?

I have a web service for a forum, and I have the following two resources:
/threads/frontpage, returns all the posts that belong on the front page of my site
/users/1, users/2, etc. returns users specified by the number.
And I want to make it so the user can ask for "all the threads on the frontpage, plus all the users that posted to those threads".
Normally I would separate it out into multiple requests, but that takes more time.
My only thought is to make a URL like this:
/threads/frontpage?includePostingUsers=true
In a way, it's taking the original result, and then using it to include additional info, in this case, the users that posted the threads.
But that doesn't seem very RESTful. There's a verb in there, and it just feels awkward. How would I do this RESTfully?
Thanks!
Having a verb in a query parameter is not necessary un-RESTful. I would say that it is common (and more important) to have clean resources and verbs, but to include more involved functionality into query parameters, as you would do with ?includePostingUsers=true.
Apigee published a nice pragmatic booklet on Crafting Restful APIs:
Web API Design – Crafting Interfaces that Developers Love (PDF), and a related video with real world observations: https://www.youtube.com/watch?v=QpAhXa12xvU#t=39m
If you don't want to show ?includePostingUsers=true in url then use Post request.
And why don't you just pass parameter like
/threads/frontpage?uid=1

recommendations for programmatic web searches

I am working on a system that needs to associate URLs with data based on keywords. I was hoping I could use a web service to automatically perform full-web searches based on keywords or tags, and the results would be in a machine-friendly format like JSON.
My first thought was Google, and their Google Custom Search service looks pretty good, and has proven itself in tests. It has a simple REST-like URL and returns results in JSON format. The only problem is that it has a limit of 100 queries per day. I need more like 1000. Their higher-quota pay option (Google Site Search) does not allow full-web searches, so is useless to me.
Surely others have wanted to do programmatic web searches before. Does Google offer another B2B search service that we could use? We are happy to pay per query, sign agreements, etc. I fear I am not looking in the right place on Google's site.
As I wrote this question I found Microsoft's Bing web services home page. At first blush it looks pretty good. I have a slight preference for Google, but am open to Microsoft. I would love to hear any advice about using Microsoft's APIs.
Google custom search offers a 'pay for >100 queries' option, I believe:
https://developers.google.com/custom-search/v1/overview
(see 'paid usage' section at the bottom)
#Sync found the right way in, and I believe I now understand the problem: Google has two control panels for custom search, and you can't get to one from the other.
I was on the panel for my Google Custom Search engine (www.google.com/cse/panel), which gives me control over low-level aspects of my search engine, and the only pay option was to convert to Google Site Search, but in so doing I would lose my full-web search power.
There is another, higher-level, control panel for all of Google's APIs (code.google.com/apis/console), of which Custom Search is a component. And from here, setting up billing to get a larger quota is clearly linked.
Sorry I am not providing proper links, as the relevant pages require login to access. While I consider this answer to be the authoritative one for my question, I am giving the green checkmark to #sync, without whose help I would not have been able to figure it out. I'd still love to see some comments on Bing's APIs, however!

Looking for fastest and least-programming-required path to implement a web site with user submitted content with voting and comments

I'm looking to throw up a web site that supports user submitted entries and allows voting and comments. Similar in form and function to FMyLife.
Basic requirements of site:
Users can submit text entries - generally 1 liners
Enters can be up or down voted
Comments allowed - presentation collapseable
Would like the fastest path possible. Ideal solution is configurable vs requirement for programming.
Have you had a look at Drupal? You can get a site up and running pretty quickly, it's very configurable, and it'll allow you to add to the site you're proposing if it grows...