I would like to implement twitter search, but with the use of their API. I think most of you know the search which they have on their home page.
Search gives such link: http://twitter.com/#search?q=ipod ubuntu
I looked in API for a possible solution, but didn't find it.
Also it would be nice if the response to the request could be in XML format, since I know that some API methods allow only json or atom.
Hope there is one(with the use of API).
Have you looked at this twitter search api documentation?
You can return results in atom or json simply with http://search.twitter.com/search.atom?q=ipod+ubuntu
or
http://search.twitter.com/search.json?q=ipod+ubuntu
Isn't atom an xml language? Shouldn't a decent xml parser be able to handle atom?
Related
Is it possible to scrap the web based on Keywords using Search engines in PHP?
Like when some put keyword, the script will search google and render the results and then render the pages and scrap/extract the line that includes the matched keywords?
Any idea or library to refer to?
You can do that using google api https://developers.google.com/custom-search/json-api/v1/overview and a related php client https://github.com/google/google-api-php-client.
Later on you need to write a web scraper to download the websites (curl) and parse the html parser (i.e. https://github.com/paquettg/php-html-parser).
I would, however, not recommend php for the latter task. There are much more sophisticated scraping tools available for python (i.e. BeautifulSoup or Scrapy) that will make your life much MUCH easier than using php.
You can use php function call
file_get_contents('web url goes here');
example file_get_contents('http://www.google.com');
That function will get the html returned from the url, then you can use xpath to extract the element of html to get the data that you want.
You can see example and more explanation url below.
https://gist.github.com/anchetaWern/6150297
I personally have done something similar of your question, but it's in ruby on rails, you can explore the project here.
https://github.com/dvarun/gextract
the xpath that I used is here:
https://github.com/dvarun/gextract/blob/master/app/jobs/fetch_keyword_job.rb
APRS.fi outputs their API calls in JSON format. I'd like to use this output to build markers in the Google Maps API. Has anyone been doing this successfully? PHP is fine if that is the way to go but maybe someone has developed a method with out it.
So I've been looking into using google base for a clients job listing project. Are there any good tutorials on using PHP and curl to interact with the google base API? I was having trouble finding one on google. I attempted to cURL to the following URL: http://www.google.com/base/feeds/snippets?bq=digital+camera and working with the XML, but it didn't seem to be properly formatted XML.
I'm pretty new to dealing with feeds although I've used simpleXML and DOMDocument quite a bit so I figure this won't be too hard.
Any ideas?
Thanks in advance.
Check here.
Is der any method to read the Google search result and display it own style . I want to read the contents of Google search results after users search for query will display only the .PDF files for the search queries is it possible to do with PHP ?
Yes, by using Google's public search API.
Like Bart mentioned you can and should use the API so as be on the up and up with Google.
But that being said if you want to really have a hack you can just make a curl request from php to do the search against google and parse the results. Or you could even do it in perl and just run the perl script from php.
But again this is not the preferred solution. I am just trying to provide an answer for your question. And yes it can be done.
I've read through the Google Spreadsheets API PHP documentation. All examples are using Zend, which I cannot use. See this page: http://code.google.com/apis/spreadsheets/docs/1.0/developers_guide_php.html
Does anybody know a simple example of the following:
How can I use PHP w/ curl (or whatever) and the Google Spreadsheets API to get the data from a Google Spreadsheets Doc?
It's my understanding that the data will be delivered in XML format. From there, I'll use PHP to manipulate it.
Google is your friend! ;)
http://code.google.com/apis/gdata/articles/php_client_lib.html
http://sim.plified.com/2008/09/14/accessing-google-spreadsheet-with-php/
http://farinspace.com/2009/05/saving-form-data-to-google-spreadsheets/
From what I can see and how most of the other Google API work, the Spreadsheet API is centered around URLs. You formulate a URL and an xml response is returned. It seams that for this particular product however, most the support is for the Zend framewok implementation. You could always download the Zend component and reverse engineer it to work.
The Google Spreadsheets Data API is documented here.
http://code.google.com/apis/spreadsheets/docs/1.0/developers_guide_protocol.html
It's a REST API so you just need appropriately formatted GETS and POSTS as described in the docs.
The Zend Gdata implementation is the official PHP library for Google APIs. Not much of an answer I guess but I have to ask, why wouldn't you just use it? (It seems like you're reinventing the wheel... :-)