Using PHP with Google Base and general feed questions - php

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.

Related

Importing /scraping page content form other sites?

i've been playing with php and also http://www.alchemyapi.com/, and embed.ly
but i was wondering if there other options out there to import and parse a webpage, any page, either is a news site or a blog...
thanks
To fetch the data: curl, file_get_contents (may be others those are the two common)
To parse the data: PHP: DOM, SimpleXML preg_match**
Since it was tagged with PHP, I only gave working information for PHP. There are tons of ways to do this, if you can narrow your question down to what you are trying to do it would help. The better ways to parse any site, is through their RSS feed if they have one, or through their API, speculating that they offer up the content you want via RSS/API.
** preg_match is not a great alternative it does "work" but better to use the DOM / Simple XML functions if possible.
I wrote a crawler at work using cURL and preg_match
Before I chose to do it that way, I had looked at DOM Parsers http://php.net/manual/en/book.dom.php

How to get RSS Feed in to my Website using PHP

I need to put rss feed in to my website using PHP. For example, I need to get RSS feed from the following site.
http://www.ainonline.com/index.php?id=5
How can i accomplish this.
As i am new bie to RSS i need some professionals help to get a deep knowledge in it.
Hope u pals do...
Thanks in advance...
You can use Zend_Feed class in an MVC project or as a standalone library.
There are examples in the manual.
It is as simple as this:
$channel = new Zend_Feed_Rss('http://www.ainonline.com/index.php?id=5');
foreach ($channel as $item) {
echo $item->title();
}
I found simplepie easy to use and well documented - saves having to understand the details of all the different feed types.
Update Here is a site with a bunch of php scripts, including RSS scripts: http://gscripts.net/free-php-scripts/RSS_Scripts.html
If you are wanting to create the entire thing from scratch check this link out. I haven't walked through the whole thing myself, but it seems nice.
http://tiffanybbrown.com/2005/12/22/dynamic-rss-feeds-using-php-mysql-and-apache/
I recommend that you know php and MySql as well as maybe reading a few tutorials about how RSS works.
Also, you could check out the RSS code in WordPress, that's what I did, though It may be a bit complicated to reverse engineer it, versus just reading tutorials and learning it from the ground up correctly.:)
Take a look at this:
http://ditio.net/2008/06/19/using-php-curl-to-read-rss-feed-xml/

Using Highrise API Wrapper

Good Day.
I am trying my hardest to get my mind around PHP for building an site where you can see Highrise events printed out.
Found this wrapper, but do not know how to use it, what i should write to get use of this wrapper.
Please Help.
http://101tec.com/en/open-source/highrise-api-wrapper is the link for the wrapper.
Have you tried this Highrise API wrapper/library:
https://github.com/ignaciovazquez/Highrise-PHP-Api
Looks more developed, with example code.

Is there a way to implement twitter search?

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?

Getting search results from Twitter in php

I'm attempting to put together a little mashup with some twitter APIs. However, the whole area is new to me (I'm more of an embedded developer dabbling). And frustratingly, every tutorial I am trying in Php is either out of date, not doing what it claims to do, it or is broken.
Essentially, I just want a nice bit of example code - say, an HTML file, a connection.js for the JQuery magic, and a php file - 'getsearch' which contains the relevant Curl calls to the API to just return the results for a given search term.
Followed the tutorial to the letter at
http://www.reynoldsftw.com/2009/02/using-jquery-php-ajax-with-the-twitter-api/
and even downloaded the guy's code and chucked it on my webserver, but it just seems to sit there.
I'm relatively competent at php and html, but it's the Curl and the JQuery side of things which is new to me, and would appreciate any thoughts, links, or code suggestions. I've attempted reading the API - but even that seems sparse - and several links are broken to their own tutorials, so that's put me off a bit for now.
Finally found a working one.
http://papermashup.com/using-the-twitter-api/
This tutorial (or just the php file at http://greenservr.com/projects/twittersearch/TwitterSearch.phps) has the basics including php, jquery and curl to get something back from the twitter API). Finally have something going, so now can expand and extend :)
check the link http://webhkp.wordpress.com/2010/04/13/twitter-api-search-follow-tweet/. this is a great post i found and really helpful for me. hope you fined something helpful here.

Categories