Count of result sites in google search and rivalry level of query - php

I'm working with PHP web site and I need to get count of sites for custom expression in Google search. Also I need to get rivality level [0..1] of this custom expression (query).
I've searching for something like this in Google Custom Search API but didn't find.
Thanx for helping.

Related

How to sort post randomly with WP REST API?

I am trying to display posts using the WP REST API and I want to display them randomly.
I know querying the posts the normal way with wordpress there is a orderby: rand option, which would do what I am looking for, but I can't figure it out with the REST API.
My REST API looks like this:
https://example.com/wp-json/wp/v2/fatos_random?filter[orderby]=rand&per_page=1
thanks for help

How to use WordPress REST API v2 to search posts?

I am writing Android application and I am using WordPress REST API v2 for communication with WordPress from my Android application. I have implemented Activity that lists all posts from single category:
http://wordpress.dev/wp-json/wp/v2/posts?categories=X
But now I am adding search box in my application where user can enter some text and now I need to use this text to perform search over all categories
I can use same endpoint but different parameters:
http://wordpress.dev/wp-json/wp/v2/posts?search=<SEARCH TEXT>
In my local wordpress database I have a lot of posts that are called "POST TITLE #XY" and one that is called "Cover Photo"
So if I execute this:
http://wordpress.dev/wp-json/wp/v2/posts?search=title,post
I get only those that has post and title in the title, however if I add one more word:
http://wordpress.dev/wp-json/wp/v2/posts?search=title,post,cover
I get zero posts...
How can I perform search and get posts that includes one or more keywords that I am sending in request?
You can use Search Results REST API Endpoint to seach by keywords you provide.
For example http://yourdomain.com/index.php/wp-json/wp/v2/search?search=lorem&per_page=5&page=1 will search for the keyword lorem in your wordpress posts.
Per_page : limits the number of results per page
I did something similar to what you are describing for a WP/bbPress android/ios app. First, I made my own wordpress search api end point to hit. Then on the wordpress side I used a custom mysql query to query post titles and post content for the search string and return that to the api.
I made the query only return 25 results as I didn't need to have more results than that, with pagination and such.

Accessing Wordpress with google custom search

This is probably a ignorant question but is there a url that all wordpress hosted sites use?
say if i used the "site: www.example.com" to refine my google search it would limit the search only to sites hosted by wordpress.
and if this isn't possible can you use google custom search to do a normal google search from within your site?
Well the first case is not possible. but if you need your users to use google to search within your site you use one of the many google search plugins, like WP Google Search. They will over ride your custom search system with the one from google.

Wordpress plugin for Google Maps that will dynamically receive addresses required

After much trawling and emailing of sales people, I have been unsuccessful in finding a Wordpress plugin for Google Maps that will work with a database.
All the plugins I have seen so far use a control panel for manually adding the addresses. I have over 1000 addresses which are searched for by users with maximum results of 250.
I would like those results to appear on a map (it doesn't have to be a Google map).
The current search engine within my Wordpress site is a custom written PHP file with a request from the functions.php file based on the page url, i.e. the shopping page brings up a shopping search box.
The database is MySQL.
Does anyone know of a plugin that will work with a database for dynamic results based on user input?
I've tried using Googles' API directly but I only write basic PHP and found it completely confusing with help files that only give circular links so I'd rather pay for a good plugin with support if it's available.
Thanks.

How to integrate Google Custom Search into my website?

I want to integrate Google Custom Search into my website searching box.
The problem is I still want to keep my searching box. In addition, if the keywords are stock symbols, will use my site search engine. If the input is not stock symbol, will use Google Custom Search to search my website.
I want to use google custom search to search my whole site. The search result should be on my website but not jump to google search.
There is a JSON/Atom Custom Search API provided by google. Is this the only way to do this?
Please advice!
Don
Start here http://www.google.com/cse/manage/create. Then you will receive a original custom google search bar. Then you can grep the query which it produces and force your own form to result in the same query.
The paid version of the Custom Search Engine has a very clean XML implementation. You could pre-process the query and check whether it's a stock ticker symbol. If it is, handle it yourself, if not, send it to the CSE, get the XML, and format as you like. I wish they had it in the free version, but they don't.
As an alternate option, there are many free open source search engines, Solr/Lucene (implementations by SearchBlox, Constellio, Lucid Imagination, etc.), Sphinx, OpenSearchServer, Elastic Search, Xapian...

Categories