This is a simple module that wraps around a php translation of the reddit api. Upon activation, Redditview creates a block that will pull in a set number of the most popular items from the users subreddit of choice, including the item title, preview thumb (if available - with link to original image), and a link to the comments associated with the subreddit item. The api can be extended much further to include commenting from drupal, upvote count, etc.

Once activated, this module creates a db table that is populated with:

Reddit Username
Reddit password
subreddit name
Number of posts to return
The form is found here: admin/config/redditview/form-fill

I intend to develop this module more and add features to include upvote count, commenting, as well as views integration, and js prettifying. Right now, I'm placing this rudimentary implementation to gauge interest in this project / module.

Project page: http://drupal.org/sandbox/EthanT/1995950

Git clone command: git clone --branch 7.x-1.x EthanT@git.drupal.org:sandbox/EthanT/1995950.git redditview

Reviews of other projects:
http://drupal.org/node/1941608#comment-7421430
http://drupal.org/node/1984222#comment-7421454
http://drupal.org/node/1913916#comment-7421488
http://drupal.org/node/1997826#comment-7426482

CommentFileSizeAuthor
Screenshot - 05152013 - 09:16:09 PM.png120.88 KBethant

Comments

PA robot’s picture

Status: Needs review » Needs work

Link to the project page and git clone command are missing in the issue summary, please add them.

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.

ethant’s picture

Added link to project page and git clone command.

ethant’s picture

Issue summary: View changes

Adding project page and git clone command.

ethant’s picture

Issue summary: View changes

Adding project review note

ethant’s picture

Issue summary: View changes

another project review added

ethant’s picture

Issue summary: View changes

added link to project review

ethant’s picture

Issue summary: View changes

added git branch info

ethant’s picture

Issue tags: +PAreview: review bonus

Completed 3 reviews for high priority review.

ethant’s picture

Status: Needs work » Needs review

Updating status

stefan lehmann’s picture

The automatic code review says that you should remove the .project file of your IDE from the repository, see http://ventral.org/pareview/httpgitdrupalorgsandboxethant1995950git-7x-1dev

Manual review of the 7.x-1.dev branch

  • Although you use a branch 7.x-1.dev, there is still a master branch available, see steps 5 & 6: http://drupal.org/node/1127732
  • You could add a link to the Configuration page in the .info file (configure = /redditview/form-fill), see http://drupal.org/node/542202
  • A standalone table for holding the configuration for your module is overkill imho. Why don't you use variables?
  • You use the Libraries API to get the path to the reddit library, but you don't have a dependency to the Libraries API in your info file.
  • As it looks like an anonymous user can overwrite your settings at any given time, is this intended? If not you'll have to add a custom permission to your implementation of hook_menu().
  • It would be cool to have a template file to change the rendering of the results easily.

And btw I think you didn't do any manual code review at all. So I'm not sure if you are even allowed to claim the PAReview: review bonus tag. But it's not to me to decide. :-)

ethant’s picture

Hey Stefan - thanks for the review. Before I address the items you found, I wanted to address your comment about me doing no manual review. After running the par script, I went through each of these modules manually, and tested them. The modules that I chose, per the instructions, were at the top of the list. It just happened that these modules happened to have all been towards the end of the review process, and have already addressed all relevant issues, leaving me very little to comment about. Sorry, but these are the cards I was dealt. Had there been newly submitted modules at the top of the queue, my comments would have been much more detailed.

molenick’s picture

From: https://drupal.org/node/1975228:
Pick the oldest application from the review bonus list and get started! (If it is empty pick the oldest from the "needs review" list)

After you did at least 3 manual reviews of other applications you have to reference them in the issue summary of your application issue. You can edit the first post (=issue summary) of an issue. Create a new section "Reviews of other projects" and add links to the exact review comment, e.g. like this one http://drupal.org/node/1381726#comment-5418942

My interpretation is that if you don't have anything to contribute beyond what has already been contributed, you should move on to the next project that needs a contribution.

I've been digging through the application queues for the past few days and there are a lot of applications that need manual review by people of different experience levels and skill sets.

Like Stefan, I'm not to judge but running pareview.sh and testing the module do not strike me the same as being a manual code review.

molenick’s picture

Status: Needs review » Needs work

A few review notes:

1) You're using branch 7.x-1.dev, when you should probably be using something like 7.x.-1.x. Read this for more information about release naming conventions.

2) I echo Stefan's concerns about protecting the settings forms with custom permissions.

3) You should avoid storing login details for other sites and services in plain text, while this isn't a security problem for the Drupal site itself, it is for the greater internet. Are there are auth options available via Reddit's API?

ethant’s picture

Status: Needs work » Needs review

Thank you for your critiques, molenick - I will be working on these this evening.

ethant’s picture

Issue summary: View changes

adding comment numbers

ethant’s picture

1) Master branch deleted.
2) Config page added.
3) Table is necessary - I plan to add to it as I extend the module with reddit account options user can store in drupal.
4) Libraries dependency added.
5) Permissions requirement added to menu hook - now user must be logged in to use form.
6) Tpl added.
7) .project file removed

ethant’s picture

1) Switched to 7.x-1.x
2) Pass now stored as hash.

ethant’s picture

Issue summary: View changes

changing git version clone command

ethant’s picture

ethant’s picture

Issue summary: View changes
ethant’s picture

Issue summary: View changes

Corrected description.

delta’s picture

My review:

line 47 .module

/**
 * Implements hook_theme().
 */
function redditview_theme() {
  $module_path = drupal_get_path('module', 'redditview');
  $base = array(
    'path' => $module_path,
  );
  return array(
    'redditview_block_items' => $base + array(
      'template' => 'redditview_content',
      'variables' => array('items' => NULL),
    ),
  );
}

why are you creating an array $base, and then concat with another array, since there are no condition, the two array declaration can be merged into one.

.module redditview_form
The form that you expose to authenticated user, may need a validation before inserting user submitted values in db.

.install line 25, 32, 39 and 46
the description values are not really helpful ;)

.tpl.php
Your template is full of php code, move it into a theme preprocess function,
truncate_utf8() must not be in a template, poor themer :)
example $the_title must already be defined and prepared in the template.

Happy to see a reddit module in here :)
good luck

delta’s picture

Status: Needs review » Needs work
ethant’s picture

Will update shortly - waiting for api author to get back to me regarding a functionality q.

PA robot’s picture

Status: Needs work » Closed (won't fix)

Closing due to lack of activity. Feel free to reopen if you are still working on this application.

I'm a robot and this is an automated message from Project Applications Scraper.

PA robot’s picture

Issue summary: View changes

typo