This module is a simple module that exposes a formatter for Link module fields to render a feed reader. If the URL of the link field is not a valid feed, then the value is ignored and not rendered.

FAQ

Q: Why use Link rss formatter instead feeds module?

A: Sometimes it's necessary display a simple feed reader from a link field without importing the feeds into nodes like feeds module. The purpose of Link rss formatter it's solve this scenario on a clean solution, using a formatter display.

Usage:

  1. Configure a content type with a link field.
  2. Download, install and enable the module.
  3. Go to the Display settings for that content type.
  4. Configure the link field to use the Link RSS formatter. Select the number of items to display and select the format desired (Default, summary or text plain).
  5. Create a content item with a URL for a RSS feed in that link field, and note that feed items are rendered.

Access

http://drupal.org/sandbox/mordonez/1365252

Git repository

git clone --branch 7.x-1.x mordonez@git.drupal.org:sandbox/mordonez/1365252.git link_rss_formatter

Requirements

Drupal 7 and link, feeds modules

CommentFileSizeAuthor
#6 drupalcs-result.txt783 bytesklausi

Comments

mordonez’s picture

Issue summary: View changes

Add Libraries section

mordonez’s picture

Issue summary: View changes

fix git repository

mordonez’s picture

Issue summary: View changes

add faq section

mordonez’s picture

Issue summary: View changes

change git repository

jinlong’s picture

Review of the 7.x-1.x branch:

  • Drupal Code Sniffer has found some code style issues (please check the Drupal coding standards):
    
    FILE: ...al-7-pareview/sites/all/modules/pareview_temp/test_candidate/README.txt
    --------------------------------------------------------------------------------
    FOUND 1 ERROR(S) AFFECTING 1 LINE(S)
    --------------------------------------------------------------------------------
     39 | ERROR | Files must end in a single new line character
    --------------------------------------------------------------------------------
    
    
    FILE: ...es/pareview_temp/test_candidate/libraries/common_syndication_parser.inc
    --------------------------------------------------------------------------------
    FOUND 55 ERROR(S) AND 2 WARNING(S) AFFECTING 43 LINE(S)
    --------------------------------------------------------------------------------
      16 | ERROR   | Last parameter comment requires a blank newline after it
      16 | ERROR   | Doc comment for var $feed does not match actual variable name
         |         | $string at position 1
      16 | ERROR   | Missing parameter type at position 1
      17 | ERROR   | Parameter comment indentation must be 2 additional spaces at
         |         | position 1
      18 | ERROR   | Data type of return value is missing
      19 | ERROR   | Return comment indentation must be 2 additional spaces
      34 | ERROR   | An operator statement must be followed by a single space
      61 | ERROR   | Last parameter comment requires a blank newline after it
      61 | ERROR   | Missing parameter type at position 1
      62 | ERROR   | Parameter comment indentation must be 2 additional spaces at
         |         | position 1
      63 | ERROR   | Data type of return value is missing
      64 | ERROR   | Return comment indentation must be 2 additional spaces
     106 | ERROR   | Inline comments must end in  full-stops, exclamation marks, or
         |         | question marks
     108 | ERROR   | Inline comments must end in  full-stops, exclamation marks, or
         |         | question marks
     126 | ERROR   | A cast statement must be followed by a single space
     132 | ERROR   | Multi-line assignments must have the equal sign on the second
         |         | line
     132 | ERROR   | An operator statement must be followed by a single space
     133 | ERROR   | Multi-line assignments must have the equal sign on the second
         |         | line
     133 | ERROR   | An operator statement must be followed by a single space
     152 | ERROR   | Line indented incorrectly; expected 12 spaces, found 14
     166 | ERROR   | Expected "foreach (...) {\n"; found "foreach (...)  {\n"
     172 | ERROR   | Expected "foreach (...) {\n"; found "foreach (...)  {\n"
     179 | ERROR   | Inline comments must start with a capital letter
     179 | ERROR   | Inline comments must end in  full-stops, exclamation marks, or
         |         | question marks
     290 | WARNING | Line exceeds 80 characters; contains 87 characters
     298 | WARNING | A comma should follow the last multiline array item. Found:
         |         | 'dc:subject'
     315 | ERROR   | Inline comments must start with a capital letter
     327 | ERROR   | You must use "/**" style comments for a function comment
     331 | ERROR   | Inline comments must start with a capital letter
     331 | ERROR   | Inline comments must end in  full-stops, exclamation marks, or
         |         | question marks
     337 | ERROR   | You must use "/**" style comments for a function comment
     371 | ERROR   | A cast statement must be followed by a single space
     372 | ERROR   | A cast statement must be followed by a single space
     373 | ERROR   | A cast statement must be followed by a single space
     387 | ERROR   | Comments may not appear after statements.
     392 | ERROR   | Comments may not appear after statements.
     405 | ERROR   | A cast statement must be followed by a single space
     421 | ERROR   | Multi-line assignments must have the equal sign on the second
         |         | line
     421 | ERROR   | An operator statement must be followed by a single space
     422 | ERROR   | Multi-line assignments must have the equal sign on the second
         |         | line
     422 | ERROR   | An operator statement must be followed by a single space
     423 | ERROR   | Multi-line assignments must have the equal sign on the second
         |         | line
     423 | ERROR   | An operator statement must be followed by a single space
     443 | ERROR   | Line indented incorrectly; expected 12 spaces, found 14
     489 | ERROR   | Last parameter comment requires a blank newline after it
     489 | ERROR   | Doc comment for var $date_string does not match actual
         |         | variable name $date_str at position 1
     489 | ERROR   | Missing parameter type at position 1
     490 | ERROR   | Parameter comment indentation must be 2 additional spaces at
         |         | position 1
     491 | ERROR   | Data type of return value is missing
     492 | ERROR   | Return comment indentation must be 2 additional spaces
     512 | ERROR   | Last parameter comment requires a blank newline after it
     512 | ERROR   | Missing parameter type at position 1
     514 | ERROR   | Data type of return value is missing
     522 | ERROR   | Inline comments must end in  full-stops, exclamation marks, or
         |         | question marks
     522 | ERROR   | Comments may not appear after statements.
     549 | ERROR   | Missing parameter type at position 1
     550 | ERROR   | Parameter comment indentation must be 2 additional spaces at
         |         | position 1
    --------------------------------------------------------------------------------
    
    
    FILE: ...tes/all/modules/pareview_temp/test_candidate/libraries/http_request.inc
    --------------------------------------------------------------------------------
    FOUND 24 ERROR(S) AND 2 WARNING(S) AFFECTING 23 LINE(S)
    --------------------------------------------------------------------------------
      30 | ERROR   | Data type of return value is missing
      31 | ERROR   | Return comment indentation must be 2 additional spaces
      76 | ERROR   | Missing parameter type at position 1
      77 | ERROR   | Parameter comment indentation must be 2 additional spaces at
         |         | position 1
      78 | ERROR   | Missing parameter type at position 2
      79 | ERROR   | Parameter comment indentation must be 2 additional spaces at
         |         | position 2
      80 | ERROR   | Last parameter comment requires a blank newline after it
      80 | ERROR   | Missing parameter type at position 3
      81 | ERROR   | Parameter comment indentation must be 2 additional spaces at
         |         | position 3
      82 | ERROR   | Data type of return value is missing
      83 | ERROR   | Return comment indentation must be 2 additional spaces
      87 | WARNING | Line exceeds 80 characters; contains 141 characters
     178 | ERROR   | Inline comments must start with a capital letter
     178 | ERROR   | Inline comments must end in  full-stops, exclamation marks, or
         |         | question marks
     178 | ERROR   | Comments may not appear after statements.
     232 | ERROR   | Data type of return value is missing
     257 | ERROR   | Parameter comment indentation must be 2 additional spaces at
         |         | position 1
     260 | ERROR   | Parameter comment indentation must be 2 additional spaces at
         |         | position 2
     263 | ERROR   | Return comment indentation must be 2 additional spaces
     284 | ERROR   | Parameter comment indentation must be 2 additional spaces at
         |         | position 1
     287 | ERROR   | Return comment indentation must be 2 additional spaces
     327 | ERROR   | Parameter comment indentation must be 2 additional spaces at
         |         | position 1
     329 | ERROR   | Missing parameter type at position 2
     330 | ERROR   | Parameter comment indentation must be 2 additional spaces at
         |         | position 2
     333 | ERROR   | Return comment indentation must be 2 additional spaces
     344 | WARNING | Line exceeds 80 characters; contains 84 characters
    --------------------------------------------------------------------------------
    
    
    FILE: .../sites/all/modules/pareview_temp/test_candidate/link_rss_formatter.info
    --------------------------------------------------------------------------------
    FOUND 1 ERROR(S) AFFECTING 1 LINE(S)
    --------------------------------------------------------------------------------
     6 | ERROR | Files must end in a single new line character
    --------------------------------------------------------------------------------
    
    
    FILE: ...ites/all/modules/pareview_temp/test_candidate/link_rss_formatter.module
    --------------------------------------------------------------------------------
    FOUND 33 ERROR(S) AND 2 WARNING(S) AFFECTING 28 LINE(S)
    --------------------------------------------------------------------------------
       8 | ERROR   | Expected 1 space(s) before asterisk; 0 found
       9 | ERROR   | Expected 1 space(s) before asterisk; 0 found
      99 | WARNING | Avoid backslash escaping in translatable strings when
         |         | possible, use "" quotes instead
     106 | ERROR   | More than 2 empty lines are not allowed
     132 | ERROR   | Expected 1 space(s) before asterisk; 0 found
     133 | ERROR   | Expected 1 space(s) before asterisk; 0 found
     134 | ERROR   | Expected 1 space(s) before asterisk; 0 found
     135 | ERROR   | Expected 1 space(s) before asterisk; 0 found
     156 | ERROR   | Break statement indented incorrectly; expected 8 spaces, found
         |         | 6
     164 | ERROR   | Break statement indented incorrectly; expected 8 spaces, found
         |         | 6
     167 | ERROR   | Break statement indented incorrectly; expected 8 spaces, found
         |         | 6
     170 | ERROR   | An operator statement must be followed by a single space
     179 | ERROR   | Expected 1 space(s) before asterisk; 0 found
     180 | ERROR   | Expected 1 space(s) before asterisk; 0 found
     181 | ERROR   | Expected 1 space(s) before asterisk; 0 found
     181 | ERROR   | Missing comment for param "$field" at position 1
     182 | ERROR   | Expected 1 space(s) before asterisk; 0 found
     182 | ERROR   | Doc comment for var $item does not match actual variable name
         |         | $instance at position 2
     182 | ERROR   | Parameter comment must be on the next line at position 2
     183 | ERROR   | Expected 1 space(s) before asterisk; 0 found
     185 | ERROR   | Line indented incorrectly; expected at least 2 spaces, found 0
     185 | ERROR   | 3 spaces found before inline comment; expected "// $settings =
         |         | $display['settings'];" but found "//   $settings =
         |         | $display['settings'];"
     202 | ERROR   | Expected 1 space(s) before asterisk; 0 found
     203 | ERROR   | Expected 1 space(s) before asterisk; 0 found
     204 | ERROR   | Expected 1 space(s) before asterisk; 0 found
     204 | ERROR   | Missing parameter type at position 1
     205 | ERROR   | Expected 1 space(s) before asterisk; 0 found
     206 | ERROR   | Expected 1 space(s) before asterisk; 0 found
     206 | ERROR   | Missing parameter type at position 2
     207 | ERROR   | Expected 1 space(s) before asterisk; 0 found
     208 | WARNING | Line exceeds 80 characters; contains 90 characters
     208 | ERROR   | Expected 1 space(s) before asterisk; 0 found
     209 | ERROR   | Expected 1 space(s) before asterisk; 0 found
     210 | ERROR   | Expected 1 space(s) before asterisk; 0 found
     226 | ERROR   | Files must end in a single new line character
    --------------------------------------------------------------------------------
    
  • ./libraries/http_request.inc: all functions should be prefixed with your module/theme name to avoid name clashes. See http://drupal.org/node/318#naming
    function http_request_get_common_syndication($url, $settings = NULL) {
    function http_request_get($url, $username = NULL, $password = NULL, $accept_invalid_cert = FALSE) {
    function http_request_use_curl() {
    function http_request_clear_cache($url) {
    function http_request_is_feed($content_type, $data) {
    function http_request_find_feeds($html) {
    function http_request_create_absolute_url($url, $base_url) {
    
  • ./libraries/common_syndication_parser.inc: all functions should be prefixed with your module/theme name to avoid name clashes. See http://drupal.org/node/318#naming
    function common_syndication_parser_parse($string) {
    function _parser_common_syndication_cache_get($url) {
    function _parser_common_syndication_feed_format_detect($xml) {
    function _parser_common_syndication_atom10_parse($feed_XML) {
    function _parser_common_syndication_RDF10_parse($feed_XML) {
    function _parser_common_syndication_RDF10_property($rdf_data, $rdf_properties = array()) {
    function _parser_common_syndication_RDF10_item($rdf_data, $mappings) {
    function _parser_common_syndication_RSS20_parse($feed_XML) {
    function _parser_common_syndication_parse_date($date_str) {
    function _parser_common_syndication_parse_w3cdtf($date_str) {
    function _parser_common_syndication_link($links) {
    function _parser_common_syndication_title($title, $body = FALSE) {
    

This automated report was generated with PAReview.sh, your friendly project application review script. Go and review some other project applications, so we can get back to yours sooner.

Source: http://ventral.org/pareview - PAReview.sh online service

mordonez’s picture

Thanks jinlong for review my code.

I reviewed the error on Readme.txt and some comments. But others errors come from a library used on feeds module. I need to repair the library errors?

Please consider to review my code again

Thanks.

drupalnetworks’s picture

Status: Needs review » Needs work

you need to either put instructions how to download library in your readme or you can use Libraries API to handle that stuff.

In theory, GPL and dual licensed stuff can stay. However, a good practice is to keep ALL third party libraries out of the repository and put instructions how to download library.
You can read more on licensing here.

You got some coding standart issues.

Review of the 7.x-1.x branch:

Drupal Code Sniffer has found some code style issues (please check the Drupal coding standards):

FILE: ...es/pareview_temp/test_candidate/libraries/common_syndication_parser.inc
--------------------------------------------------------------------------------
FOUND 14 ERROR(S) AFFECTING 14 LINE(S)
--------------------------------------------------------------------------------
137 | ERROR | Multi-line assignment not indented correctly; expected 8 spaces
| | but found 6
138 | ERROR | Multi-line assignment not indented correctly; expected 8 spaces
| | but found 6
294 | ERROR | Whitespace found at end of line
332 | ERROR | You must use "/**" style comments for a function comment
342 | ERROR | You must use "/**" style comments for a function comment
352 | ERROR | Whitespace found at end of line
413 | ERROR | A cast statement must be followed by a single space
430 | ERROR | Multi-line assignment not indented correctly; expected 6 spaces
| | but found 8
431 | ERROR | Multi-line assignment not indented correctly; expected 10 spaces
| | but found 8
432 | ERROR | Multi-line assignment not indented correctly; expected 10 spaces
| | but found 8
433 | ERROR | Multi-line assignment not indented correctly; expected 10 spaces
| | but found 8
499 | ERROR | Parameter comment indentation must be 2 additional spaces at
| | position 1
500 | ERROR | Whitespace found at end of line
502 | ERROR | Return comment indentation must be 2 additional spaces
--------------------------------------------------------------------------------

FILE: ...tes/all/modules/pareview_temp/test_candidate/libraries/http_request.inc
--------------------------------------------------------------------------------
FOUND 24 ERROR(S) AND 2 WARNING(S) AFFECTING 23 LINE(S)
--------------------------------------------------------------------------------
30 | ERROR | Data type of return value is missing
31 | ERROR | Return comment indentation must be 2 additional spaces
76 | ERROR | Missing parameter type at position 1
77 | ERROR | Parameter comment indentation must be 2 additional spaces at
| | position 1
78 | ERROR | Missing parameter type at position 2
79 | ERROR | Parameter comment indentation must be 2 additional spaces at
| | position 2
80 | ERROR | Last parameter comment requires a blank newline after it
80 | ERROR | Missing parameter type at position 3
81 | ERROR | Parameter comment indentation must be 2 additional spaces at
| | position 3
82 | ERROR | Data type of return value is missing
83 | ERROR | Return comment indentation must be 2 additional spaces
87 | WARNING | Line exceeds 80 characters; contains 141 characters
178 | ERROR | Inline comments must start with a capital letter
178 | ERROR | Inline comments must end in full-stops, exclamation marks, or
| | question marks
178 | ERROR | Comments may not appear after statements.
232 | ERROR | Data type of return value is missing
257 | ERROR | Parameter comment indentation must be 2 additional spaces at
| | position 1
260 | ERROR | Parameter comment indentation must be 2 additional spaces at
| | position 2
263 | ERROR | Return comment indentation must be 2 additional spaces
284 | ERROR | Parameter comment indentation must be 2 additional spaces at
| | position 1
287 | ERROR | Return comment indentation must be 2 additional spaces
327 | ERROR | Parameter comment indentation must be 2 additional spaces at
| | position 1
329 | ERROR | Missing parameter type at position 2
330 | ERROR | Parameter comment indentation must be 2 additional spaces at
| | position 2
333 | ERROR | Return comment indentation must be 2 additional spaces
344 | WARNING | Line exceeds 80 characters; contains 84 characters
--------------------------------------------------------------------------------
mordonez’s picture

I added feeds dependency module to resolve the problem with libraries.

Please consider to review my code again.

Thanks!

mordonez’s picture

Status: Needs work » Needs review

change status to "news review"

mordonez’s picture

Issue summary: View changes

minor changes

klausi’s picture

Status: Needs review » Needs work
StatusFileSize
new783 bytes

Review 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. Go and review some other project applications, so we can get back to yours sooner.

manual review:

  • _link_rss_formatter_formatter_process(): why do you need http_request.inc? why can't you use drupal_http_request()?
  • "$item = '<h3><a href="' . $element['url'] . '" >' . $element['title'] . '</a></h3>';": you should sanitize the remotely provided data with check_url() and check_plain().
  • "$item .= text_summary($element['description']);": you should at least run filter_xss() on the data before printing it.
misc’s picture

@mordonez has been contacted to ask if the application is abandoned.

After ten weeks with a status of needs work: the applicant may be contacted by a reviewer to determine whether the application was indeed abandoned. The action taken by the reviewer should be documented in the project application issue.

http://drupal.org/node/894256

klausi’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.

klausi’s picture

Issue summary: View changes

removed library section and added feeds dependency