github
Advanced Search
  • Home
  • Pricing and Signup
  • Explore GitHub
  • Blog
  • Login

kulor / yql_php

  • Admin
  • Watch Unwatch
  • Fork
  • Your Fork
  • Pull Request
  • Download Source
    • 4
    • 0
  • Source
  • Commits
  • Network (0)
  • Issues (0)
  • Downloads (0)
  • Wiki (1)
  • Graphs
  • Tree: da559e9

click here to add a description

click here to add a homepage

  • Branches (1)
    • master
  • Tags (0)
Sending Request…
Enable Donations

Pledgie Donations

Once activated, we'll place the following badge in your repository's detail box:
Pledgie_example
This service is courtesy of Pledgie.

Interface with YQL using a nice query helper and extract the results nicely using the MVC workings of CodeIgniter — Read more

  cancel

http://www.carbonsilk.com/yql_php

  cancel
  • Private
  • Read-Only
  • HTTP Read-Only

This URL has Read+Write access

Adding lots of mainly look and feel changes 
kulor (author)
Thu Feb 12 04:40:10 -0800 2009
commit  da559e966663a519f436d0aa9944212582806b98
tree    0ce244b9648b5c8d1419bc0f815fd00f70e15b01
parent  d7c775fe38dded9e36a5d453ac1f1b97d44e20b7
yql_php / system / application / controllers / yql.php system/application/controllers/yql.php
100644 103 lines (83 sloc) 3.854 kb
edit raw blame history
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
<?php
class Yql extends Controller {
 
function __construct()
{
parent::Controller();
$this->load->library('yql_lib');
}
 
 
function index()
{
$data['examples'][] = array('href' => '/yql_php/yql/geo_lookup/LHR', 'title' => 'Geo lookup for "LHR"');
$data['examples'][] = array('href' => '/yql_php/yql/search_flickr/kulor', 'title' => 'Search Flickr for "kulor"');
$data['examples'][] = array('href' => '/yql_php/yql/search_yahoo/kulor', 'title' => 'Search Yahoo for "kulor"');
$data['examples'][] = array('href' => '/yql_php/yql/search_wikipedia/open', 'title' => 'Search Wikipedia for "open"');
$data['examples'][] = array('href' => '/yql_php/yql/search_twitter/kulor', 'title' => 'Search Twitter for "kulor"');
$data['examples'][] = array('href' => '/yql_php/yql/finance_topstories', 'title' => 'Finance Top stories');
        $this->load->view('index', $data);
}
 
 
function geo_lookup($location = 'LHR')
{
$yql_query = "select name,centroid,woeid from geo.places where text=\"" . $location . "\"";
$results['query'] = $yql_query;
$results['search'] = $this->yql_lib->query($yql_query);
$results['page_title'] = 'Geo Lookup';
 
$this->load->view('header', $results);
$this->load->view('query_output', $results);
$this->load->view('yql_geo_lookup', $results);
$this->load->view('footer');
}
 
 
function search_twitter($term = 'kulor')
{
$yql_query = 'select * from json where url="http://search.twitter.com/search.json?q=' . $term . '" and itemPath = "json.results"';
$results['query'] = $yql_query;
$results['search'] = $this->yql_lib->query($yql_query);
$results['page_title'] = 'Twitter search results';
 
$this->load->view('header', $results);
$this->load->view('query_output', $results);
$this->load->view('yql_search_twitter', $results);
$this->load->view('footer');
}
 
 
function search_flickr($term = 'kulor')
{
$yql_query = 'select * from flickr.photos.search where text="' . $term . '" limit 10';
$results['query'] = $yql_query;
$results['search'] = $this->yql_lib->query($yql_query)->photo;
$results['page_title'] = 'Flickr search results';
 
$this->load->view('header', $results);
$this->load->view('query_output', $results);
$this->load->view('yql_search_flickr', $results);
$this->load->view('footer');
}
 
 
function search_yahoo($term = 'kulor')
{
$yql_query = 'select * from search.web where query="' . $term . '"';
$results['query'] = $yql_query;
$results['search'] = $this->yql_lib->query($yql_query)->result;
$results['page_title'] = 'Yahoo search results';
 
$this->load->view('header', $results);
$this->load->view('query_output', $results);
$this->load->view('yql_search_yahoo', $results);
$this->load->view('footer');
}
 
 
function search_wikipedia($term = 'open')
{
$yql_query = 'select * from xml where url="http://en.wikipedia.org/w/api.php?action=opensearch&search=' . $term . '&format=xml" and itemPath = "SearchSuggestion.Section.Item"';
$results['query'] = $yql_query;
$results['search'] = $this->yql_lib->query($yql_query)->Item;
$results['page_title'] = 'Wikipedia search results';
 
$this->load->view('header', $results);
$this->load->view('query_output', $results);
$this->load->view('yql_search_wikipedia', $results);
$this->load->view('footer');
}
 
function finance_topstories(){
$yql_query = 'select * from html where url="http://finance.yahoo.com/q?s=yhoo" and xpath=\'//div[@id="yfi_headlines"]/div[2]/ul/li/a\'';
$results['query'] = $yql_query;
$results['search'] = $this->yql_lib->query($yql_query)->a;
$results['page_title'] = 'Finance Topstories for "YHOO"';
 
$this->load->view('header', $results);
$this->load->view('query_output', $results);
$this->load->view('yql_finance_topstories', $results);
$this->load->view('footer');
}
}
Blog | Support | Training | Contact | API | Status | Twitter | Help | Security
© 2010 GitHub Inc. All rights reserved. | Terms of Service | Privacy Policy
Powered by the Dedicated Servers and
Cloud Computing of Rackspace Hosting®
Dedicated Server