This module shows a small block with bitcoin exchange rate cryptocurrency.

Link to sandbox: https://www.drupal.org/sandbox/drupal-developer/2567109

It also shows a tab to calculate Mexican pesos MXN to bitcoin. I have not seen a module of Mexican pesos to Bitcoin

Its use is only recommended for the following currencies MXN, USD, BTC.

Peso to BitCoin

For test module use:

git clone --branch 7.x-1.x http://git.drupal.org/sandbox/drupal-developer/2567109.git bitapeso_block
cd bitapeso_block

Any questions or support raul@ninja-code.de

http://git.drupal.org/sandbox/drupal-developer/2567109.git

Pledges

For Drupa 8 module, i am start work in 6 months.
If in the future more open currency vs BitCoin? possibly I encouraged me.

Credits

Bitapeso.com / Cesar Gaytan is API Owned.

Paypal

For your donations paypal account:support@hosting-openbsd.info

Help wanted!

Yes, help is always welcome.

Enjoy it

CommentFileSizeAuthor
pesotobitcoin.png12.51 KBkanzer
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

kanzer created an issue. See original summary.

kanzer’s picture

Issue summary: View changes
kanzer’s picture

Title: Bitapeso block » [D7] Bitapeso block
PA robot’s picture

Issue summary: View changes
Status: Needs review » Needs work

There are some errors reported by automated review tools, did you already check them? See http://pareview.sh/pareview/httpgitdrupalorgsandboxdrupal-developer25671...

Fixed the git clone URL in the issue summary for non-maintainer users.

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.

kanzer’s picture

Issue summary: View changes
kanzer’s picture

Status: Needs work » Needs review
nitvirus’s picture

Hi,

Ran the module through coder:
bitapeso_block.module

severity: normalLine 32: Use uppercase for PHP constants, e.g. NULL, TRUE, FALSE
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
severity: normalLine 33: Use uppercase for PHP constants, e.g. NULL, TRUE, FALSE
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
severity: normalLine 34: missing space after comma
curl_setopt($ch, CURLOPT_URL,$api);
severity: normalLine 37: Use uppercase for PHP constants, e.g. NULL, TRUE, FALSE
$get = json_decode($result, true);
severity: normalLine 40: missing space after comma
'undolar' => round($get['dolar'],2),

Some missing spaces after commas.

Also, try to put a one line break between end of function and starting of new function, it enables easier reading of code.

shams022’s picture

Git errors:
Git default branch is not set, see https://www.drupal.org/node/1659588

Sudhakar Dhanapalan’s picture

Hi,

I reviewed your module and found following issues :

1. I have using Drupal core Jquery library version (1.4) on function is not working. so please change to jquery live function or mention in Readme.txt (Not support to less than 1.6).

2. Please do proper space in (*) Line 30 to 37.

function bitapeso_block() {
$api="http://bitapeso.com/json/"; 
$ch = curl_init();
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_URL,$api);
$result=curl_exec($ch);
curl_close($ch);
$get = json_decode($result, true);

  $variables = array(
    'undolar' => round($get['dolar'],2),
    'unbitcoinmxn' => $get['mxn'],
    'unbitcoinusd' => $get['usd'],
    'cantidad' => '1',
  );

  return theme('bitapeso_block', $variables);

3. Please fix pareview suggestion: http://pareview.sh/pareview/httpgitdrupalorgsandboxdrupal-developer2567109git

arunkumark’s picture

@kanzer

Manual review suggestions

1. In bitapeso_block_block_info() line 16, you can able to use description, that help to additional details about block.

2. Line 28 Give some Documentation for the your custom function block callback bitapeso_block().

3. In function bitapeso_block() you have used Curl function. Need to use curl time out function. Because when remote server down your application wont affect its failure.

Ex:
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT , TIME_IN_SECOND); // For connection establish.
curl_setopt($ch, CURLOPT_TIMEOUT, TIME_IN_SECOND); // For fetch data.

or use drupal drupal_http_request().

kanzer’s picture

thank you for your help

these days to repair the code with advice.

Thank you

NitinSP’s picture

Status: Needs review » Needs work

Manual Review

1. Please use sanitization functions for data that you display from bitapeso service.
2. remove .css & .js file from .info file and only add it where it needed.
3. Please implement hook_help()
4. in bitapeso_block_block_view() you can able to add $block['subject'] that help you for additional details for this block

PA robot’s picture

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

Closing due to lack of activity. If you are still working on this application, you should fix all known problems and then set the status to "Needs review". (See also the project application workflow).

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

apaderno’s picture

Issue tags: -drupal 7