1 | === Google News ===
|
---|
2 | Contributors: Olav Kolbu
|
---|
3 | Donate link: http://www.kolbu.com/donations/
|
---|
4 | Tags: widget, plugin, google, news, google news, rss, feed
|
---|
5 | Requires at least: 2.3.3
|
---|
6 | Tested up to: 2.8.1
|
---|
7 | Stable tag: trunk
|
---|
8 |
|
---|
9 | Displays news items from selectable Google News RSS feeds,
|
---|
10 | inline, as a widget or in a theme. Multiple feeds allowed.
|
---|
11 | Query filters and caching.
|
---|
12 |
|
---|
13 | == Description ==
|
---|
14 |
|
---|
15 | Google aggregates news from over 4500 news sources, updated
|
---|
16 | continously. The results can be retrieved as a number of
|
---|
17 | RSS feeds, where you can create your own specific feed by
|
---|
18 | specifying one of more than 40 regions/languages, and an
|
---|
19 | optional topic ranging from Domestic to Most Popular to
|
---|
20 | Entertainment. Currently there are nine topics, including,
|
---|
21 | of course, All. In addition to this, any feed can be filtered
|
---|
22 | through a search query so that only news items matching your
|
---|
23 | query will be shown. Note that not all combinations of
|
---|
24 | region/language and topic has been enabled by Google but
|
---|
25 | it should degrade gracefully.
|
---|
26 |
|
---|
27 | This plugin works both as a widget, as inline content
|
---|
28 | replacement and can be called from themes. Any number of
|
---|
29 | inline replacements or theme calls allowed, but only one
|
---|
30 | widget instance is supported in this release.
|
---|
31 |
|
---|
32 | For widget use, simply use the widget as any other after
|
---|
33 | selecting which feed it should display. For inline content
|
---|
34 | replacement, insert the one or more of the following strings in
|
---|
35 | your content and they will be replaced by the relevant news feed.
|
---|
36 | For theme use, add the do_action function call described below.
|
---|
37 |
|
---|
38 | 1. **`<!--google-news-->`** for the default feed
|
---|
39 | 1. **`<!--google-news#feedname-->`**
|
---|
40 |
|
---|
41 | Shortcodes can be used if you have WordPress 2.5 or above,
|
---|
42 | in which case these replacement methods are also available.
|
---|
43 |
|
---|
44 | 1. **`[google-news]`** for the default feed
|
---|
45 | 1. **`[google-news name="feedname"]`**
|
---|
46 |
|
---|
47 | Calling the plugin from a theme is done with the WP do_action()
|
---|
48 | system. This will degrade gracefully and not produce errors
|
---|
49 | or output if plugin is disabled or removed.
|
---|
50 |
|
---|
51 | 1. **`<?php do_action('google_news'); ?>`** for the default feed
|
---|
52 | 1. **`<?php do_action('google_news', 'feedname'); ?>`**
|
---|
53 |
|
---|
54 | Enable plugin, go to the Google News page under
|
---|
55 | Dashboard->Settings and read the initial information. Then
|
---|
56 | go to the Google News page under Dashboard->Manage and
|
---|
57 | configure one or more feeds. Then use a widget or insert
|
---|
58 | relevant strings in your content or theme.
|
---|
59 |
|
---|
60 | Additional information:
|
---|
61 |
|
---|
62 | The available options are as follows.
|
---|
63 |
|
---|
64 | **Name:** Optional feed name, that can be used in the
|
---|
65 | widget or the inline replacement string to reference
|
---|
66 | a specific feed. Any feed without a name is considered
|
---|
67 | "default" and will be used if the replacement strings do
|
---|
68 | not reference a specific feed. If there are more than
|
---|
69 | one feed with the same name, a random of these is picked
|
---|
70 | every time it is used. This also applies to the default
|
---|
71 | feed(s).
|
---|
72 |
|
---|
73 | **Title:** Optional, which when set will be used in the
|
---|
74 | widget title or as a header above the news items when
|
---|
75 | inline. If the title is empty, then a default title
|
---|
76 | of "Google News : <region> : <feed type>" is used. Note
|
---|
77 | that as per Google Terms of Service it is a requirement
|
---|
78 | to state that the news come from Google.
|
---|
79 |
|
---|
80 | **News region:** A dropdown list of 40 choices, determining
|
---|
81 | the region/language of the feed.
|
---|
82 |
|
---|
83 | **News type:** Another dropdown list, determining what type of
|
---|
84 | news you are after. Sci/Tech, Business, Health etc.
|
---|
85 |
|
---|
86 | **Output type:** Some Google feeds come with just text,
|
---|
87 | some pictures or pictures on nearly every news item. Chose
|
---|
88 | which one you want here.
|
---|
89 |
|
---|
90 | **News item length:** Short or long. The short version is really just
|
---|
91 | the news item title as a one liner but probably the one most
|
---|
92 | WP admins will use. The long version is a 3-4 line teaser that
|
---|
93 | has been severely stripped of useless markup that Google insists
|
---|
94 | on passing along, including tables, links, colour/font/style
|
---|
95 | settings etc. I've tried to clean it up so it won't mess up your
|
---|
96 | theme. For the short version, the long text without html tags is
|
---|
97 | available as a mouse rollover/tooltip.
|
---|
98 |
|
---|
99 | **Max items to show:** As the title says, if the feed has
|
---|
100 | sufficient entries to fulfil the request.
|
---|
101 |
|
---|
102 | **Optional query filter:** One of the most important parts of
|
---|
103 | the Google News RSS Feed is the ability to filter the news
|
---|
104 | with your very own search query. Get relevant, up to date
|
---|
105 | news on the exact topic you want. Note that if you add a
|
---|
106 | search query, then the short item length will include an
|
---|
107 | "all N news articles" link curtesy Google. If you choose
|
---|
108 | to add a query, then you most likely want to set a title
|
---|
109 | as well. To explain to the viewer what kind of news you have
|
---|
110 | selected for them to see. The News Query isn't like a standard
|
---|
111 | Google Query, so you can't use || between words to search
|
---|
112 | for one or the other. So IFF you start your query with
|
---|
113 | the word **OR** then the rest of the words will be or'ed
|
---|
114 | together. I.e. a query string of 'OR this that' will look
|
---|
115 | for news containing either this or that. This is really
|
---|
116 | just a test, so the actual query language used here may change in
|
---|
117 | future versions.
|
---|
118 |
|
---|
119 |
|
---|
120 | **Cache time:** The feeds are now fetched using WordPress
|
---|
121 | builtin MagpieRSS system, which allows for caching of feeds
|
---|
122 | a specific number of seconds. Cached feeds are stored in
|
---|
123 | the backend database.
|
---|
124 |
|
---|
125 | Clicking on a news item will of course take you via Google to
|
---|
126 | the news site with the relevant article, as per Google Terms of Use.
|
---|
127 |
|
---|
128 | If you want to change the look&feel, the inline table is
|
---|
129 | wrapped in a div with the id "google-news-inline" and the
|
---|
130 | widget is wrapped in an li with id "google-news". Let me
|
---|
131 | know if you need more to properly skin it.
|
---|
132 |
|
---|
133 | **[Download now!](http://downloads.wordpress.org/plugin/google-news.zip)**
|
---|
134 |
|
---|
135 | [Support](http://www.kolbu.com/2008/04/07/google-news-plugin/)
|
---|
136 |
|
---|
137 | [Donate](http://www.kolbu.com/donations/)
|
---|
138 |
|
---|
139 |
|
---|
140 | == Installation ==
|
---|
141 |
|
---|
142 | This section describes how to install the plugin and get it working.
|
---|
143 |
|
---|
144 | e.g.
|
---|
145 |
|
---|
146 | 1. Unzip into the `/wp-content/plugins/` directory
|
---|
147 | 1. Activate the plugin through the Dashboard->Plugins admin menu.
|
---|
148 | 1. See configuation pages under Dashboard->Settings, Dashboard->Tools and on the widget page.
|
---|
149 |
|
---|
150 | Note if you're upgrading from a previous release, there may be
|
---|
151 | some strangeness the first time you edit an old feed. Try again
|
---|
152 | and it will work. Or delete the feed and create again, guaranteed
|
---|
153 | fix. :-)
|
---|
154 |
|
---|
155 | == Screenshots ==
|
---|
156 |
|
---|
157 | 1. Widget in action under the Prosumer theme. Note the mouseover showing additional text from the news item.
|
---|
158 | 2. Small part of the admin Manage page for the plugin.
|
---|
159 | 3. Inline example under the Prosumer theme, replacing <!--google-news--> in content.
|
---|
160 |
|
---|
161 | == Changelog ==
|
---|
162 |
|
---|
163 | 1. 1.0 Initial release
|
---|
164 | 1. 1.1 Removed dependency on PHP 5.1++ functionality.
|
---|
165 | Fixed UTF8-related bugs.
|
---|
166 | - Not a public release.
|
---|
167 | 1. 2.0 Rewritten from scratch. Now uses a class to avoid polluting the
|
---|
168 | name space. Hopefully adhering to best practices plugin writing.
|
---|
169 | Can now be used both as a widget and as inline content replacement.
|
---|
170 | 1. 2.0.1 Minor bugfix. Options were reset in some circumstances.
|
---|
171 | 1. 2.1 Major rewrite, again.
|
---|
172 | Multiple feeds allowed.
|
---|
173 | Using WP builtin RSS fetching and caching system.
|
---|
174 | Shortcodes are supported.
|
---|
175 | Rewrote more PHP5-only code, should now work fine with PHP4
|
---|
176 | 1. 2.2 Queries starting with OR will use remaining words in query
|
---|
177 | as ORed search. I.e. 'OR this that' will search for this or that.
|
---|
178 | Ability to call plugin from a theme.
|
---|
179 | Bugfixes for admins with db table character sets not matching that
|
---|
180 | of their WordPress install.
|
---|
181 | 1. 2.3 Fixed problems when plugin was used in themes
|
---|
182 | 1. 2.4 Fixed WP 2.7 compat problems
|
---|
183 | 1. 2.4.1 Fixed minor markup glitch
|
---|
184 | 1. 2.5 Added 25 new languages/locations
|
---|
185 |
|
---|
186 | Known bugs:
|
---|
187 | - None at this time
|
---|
188 | - Unconfigured feeds are not wrapped in matching html containers. </li?>
|
---|