This module makes it possible to select and collect content from
The Guardian newspaper for reuse on your Drupal site via the Open Platform API.
You can use this module to get access to over 1 million articles dating back 10 years in addition to the most recent content published on a daily basis.
Straight after installing this module you will be able to display a block on your page showing the latest headlines based on your search criteria. You will also have the option to display thumbnails in the block along with short trail text if you so wish.
Set your search criteria at admin/config/services/open-platform
In order to publish an entire article on your site you will need to get an API key which can be easily obtained from here http://guardian.mashery.com/.
Once you have an API key go to admin/config/services/open-platform and add your API key to the field labelled API KEY.
You can now go to admin/config/services/open-platform and publish content returned from your search query in your site.
This module will appeal to any kind of site that would like to offer its users the most up to date news. Or maybe you would like to show the latest news articles based on a particular topic on your site and allow your users to have open discussions on the content.
Project page
https://drupal.org/sandbox/t14/1974838
Git repo
git clone --branch 7.x-1.x http://git.drupal.org/sandbox/t14/1974838.git
Reviewed Projects
https://drupal.org/node/2066099#comment-7771233
https://drupal.org/node/2064317#comment-7769955
https://drupal.org/node/2088391#comment-7858599
https://drupal.org/node/2104683#comment-7934279
https://drupal.org/node/2097475#comment-7948275
https://drupal.org/node/2094477#comment-7948345
Comments
Comment #0.0
t14 CreditAttribution: t14 commentedAdded links to reviewed projects comments
Comment #1
PA robot CreditAttribution: PA robot commentedThere are some errors reported by automated review tools, did you already check them? See http://pareview.sh/pareview/httpgitdrupalorgsandboxt141974838git
We are currently quite busy with all the project applications and we prefer projects with a review bonus. Please help reviewing and put yourself on the high priority list, then we will take a look at your project right away :-)
Also, you should get your friends, colleagues or other community members involved to review this application. Let them go through the review checklist and post a comment that sets this issue to "needs work" (they found some problems with the project) or "reviewed & tested by the community" (they found no major flaws).
I'm a robot and this is an automated message from Project Applications Scraper.
Comment #2
t14 CreditAttribution: t14 commentedFixed.
Comment #3
bappa.sarkar CreditAttribution: bappa.sarkar commentedYou can use drupal_http_request($url) rather open_platform_get_content($url)
Comment #4
abghosh82 CreditAttribution: abghosh82 commentedI like the module and idea for getting news from open platform is good, following are some of minor code review suggestions:
open_platform.module - On line no. 215, 252 please use some short descritive variable name for $x.
open_platform.module - On line no. 259, instead of using 'img' tag you can consider using theme_image.
open_platform.module - Functions 'open_platform_get_dummy_data' and 'open_platform_formatted_data' etc. you can consider these function which I belive is to povide mock data for testing into a sreperate inc file wich can be included in the test. This is just to make the main functional code separate from solely test related code
Other than these I installed the module, some notices and warning that I got:
On 'admin/config/services/open-platform'
Warning: Invalid argument supplied for foreach() in open_platform_get_end_points() (line 309 of /var/www/html/d7/sites/all/modules/custom/open_platform/open_platform.module).
Notice: Undefined variable: endpoint_values in open_platform_get_end_points() (line 329 of /var/www/html/d7/sites/all/modules/custom/open_platform/open_platform.module).
On 'admin/structure/open-platform' got this for the first time, later it went off.
Recoverable fatal error: Argument 4 passed to open_platform_options() must be of the type array, null given, called in /var/www/html/d7/sites/all/modules/custom/open_platform/forms/open_platform_preview_form.inc on line 23 and defined in open_platform_options() (line 127 of /var/www/html/d7/sites/all/modules/custom/open_platform/open_platform.module).
Also noticed on you issue description the git clone link for non maintainer is not the correct one, I think use the one on your project page.
Comment #4.0
abghosh82 CreditAttribution: abghosh82 commentedlink to review comment
Comment #5
wesleydv CreditAttribution: wesleydv commentedopen_platform.info
3: I don't this is correct
open_platform.module
97: This requires that CURL is available on server: mention on project page or consider replacing by drupal_http_request().
114: Typo
120: Typo
133: Remove empty line
142: Remove empty line
157: Typo
158: Try keeping consistency in use of quotes vs double quotes
172: Typo
197: Typo
284: Remove empty line
304: Indentation looks a bit off
317: Indentation looks a bit off
469: Typo
542: Typo
576: Unused parameter $index
631: I think mocking code should be in the actual test not in the module file (not sure)
open_platform_block.tpl.php
8: Remove line
9: Remove empty line
35: Remove extra spaces
open_platform_admin_form.tpl.php
5: Typo
open_platform_preview_form.tpl.php
5: Typo
49: Typo
130: Typo
open_platform.css.css
Remove double file extension
Comment #6
t14 CreditAttribution: t14 commented@bappa.sarkar Agreeded drupal_http_request would better suited for this use case. It also means user do not have to worry about having curl setup.
Changes made and commited
Comment #7
t14 CreditAttribution: t14 commented@wesleydv Thank you for your review. Made the changes you suggested.
With the exception of the "576: Unused parameter $index" this is needed for the array recursive function in the .module file on line 216.
@abghosh82 Thank you for your comments, I applied your suggestions will fix the php warnings and put this back to "needs review"
Comment #8
t14 CreditAttribution: t14 commentedadding a review bonus tg
Comment #9
t14 CreditAttribution: t14 commentedComment #10
rameshrasaiyan CreditAttribution: rameshrasaiyan commentedHi,
I manually reviewed your code and found few minor things.
In the open_platform_preview_form.inc file you have used a img tag (
'thumbnail' => "<img src='" . $thumbnail . "' />"
), instead you can use the theme_image() Drupal API.And in the open_platform.module file few items are missing the t().
For example:-
Also I don't think you required this "open_platform.test" file in the repo.
Thanks,
Ramesh
Comment #11
t14 CreditAttribution: t14 commentedThanks for your review.
Made the changes you suggested. However the open_platform.test is need for doing simple test. There is a nice tutorial in the link below if you will like to know more about simple test.
https://drupal.org/simpletest-tutorial-drupal7
Thanks
T
Comment #12
jojototh CreditAttribution: jojototh commentedHello,
you have some style issues in your code, you can check it here:
http://pareview.sh/pareview/httpgitdrupalorgsandboxt141974838git
Also I run your module through coder module and I get these errors:
Actually titles in menus should not be enclosed with t() function, because it would cause that the string is transformed 2 times through the function. The title is automatically passed to title callback, which is by default set to t() function.
https://api.drupal.org/api/drupal/modules!system!system.api.php/function...
The last thing which I noticed is your implementation of hook_block_view. Move all code in open_platform_block_view into your case. (case 'data':). For now all the code which is not in this case is called for each block.
Otherwise it looks fine.
Comment #13
t14 CreditAttribution: t14 commentedThank you for your review.
Fixed the issues you pointed out
Thanks
T
Comment #14
t14 CreditAttribution: t14 commentedThank you for your review.
Fixed the issues you pointed out
Thanks
T
Comment #15
klausiReview of the 7.x-1.x branch:
This automated report was generated with PAReview.sh, your friendly project application review script. You can also use the online version to check your project. You have to get a review bonus to get a review from me.
manual review:
Removing review bonus tag, you can add it again if you have done another 3 reviews of other projects.
Comment #16
t14 CreditAttribution: t14 commentedHi
Fixed the automated review issues and also the manual ones.
open_platform_format_data() filters for XSS by calling array_walk_recursive which uses open_platform_filter_xss_array() as its callback function.
Thanks for your time
T
Comment #16.0
t14 CreditAttribution: t14 commentednon maintainer git clone
Comment #17
klausiOh, sorry about the XSS false alarm then, seems like you already took care of that.
manual review:
But that are not critical application blockers, otherwise I think this is RTBC. Removing review bonus tag, you can add it again if you have done another 3 reviews of other projects.
Assigning to kscheirer as he might have time to take a final look at this.
Comment #18
klausiTrying to assign again.
Comment #19
kscheirer'cache' => DRUPAL_CACHE_GLOBAL
in open_platform_block_info()? Also your cache_set is not cached for 30 minutes, it's actually permanent unless you provide a timestamp as the 4th parameter.$template_vars = array();
at the top, then you don't need that giant if statement.I'm not sure I agree with the general approach of the module. You've pre-defined quite a bit to make it useful out of the box, but also limited what can be done. Perhaps this is by design, but a much more Drupally approach would be to use Feeds (see https://drupal.org/node/856644) or let people have more control about the content type used for articles.
Most of the above are style suggestions, I don't see any blocking issues. I just read klausi's note above, and getting the dependency list into the .info file is pretty important.
Thanks for your contribution, t14!
I updated your account to let you promote this to a full project and also create new projects as either a sandbox or a "full" project.
Here are some recommended readings to help with excellent maintainership:
You can find lots more contributors chatting on IRC in #drupal-contribute. So, come hang out and get involved!
Thanks, also, for your patience with the review process. Anyone is welcome to participate in the review process. Please consider reviewing other projects that are pending review. I encourage you to learn more about that process and join the group of reviewers.
Thanks to the dedicated reviewer(s) as well.
----
Top Shelf Modules - Crafted, Curated, Contributed.
Comment #20.0
(not verified) CreditAttribution: commentedreviewed another 3 modules