Little Gem Software

Cloud Hash
Available on the App Store

Cloud Hash

  • Features
    Are you into Bitcoin and have an account at CEX.IO then this application is just what you need.

    Cloud Hash helps you to keep track of your balance and open orders for the various crypto currencies supported by CEX.IO.
    Stacks Image 175
    If you don't have an CEX.IO account yet, you can sign up for a free account using this link.
  • Screenshots
    Stacks Image 400
    On the Account Balance page the balance for all of your crypto currencies and hashing power registered at CEX.IO is displayed.

    For each item the following information is presented

    - Available - Amount available for trading
    - Orders - Amount reserved as result of open orders
    - Total - The sum of all of the above

    If there is an amount reserved for open orders more details are available on the Open Orders page. To access the Open Orders page tap on the currency for which you would like the details to be presented.
    Open Orders
    On the Open Orders page you will find a list of all the open orders you have for the selected crypto currency.

    Both Buy and Sell Orders are listed
    Stacks Image 416
    On the Network Statistics page you can find information on the Bitcoin network, including number of Bitcoins in circulation, network hash rate.

    Additionally information about time required to solve a block, number of blocks solved per hour and block difficulty (current, next and ETA) is available.
    Stacks Image 424
    On the Revenue Calculator page you can estimate the revenue and break-even days for your mining hardware.

    Tapping the Estimate Revenue-button will update the information for Difficulty, Bitcoins per Block and the Bitcoin Selling Price and perform the calculation using the information currently displayed.
  • Changelog

    For my company's website I use Rapidweaver to build and maintain it. also Rapidweaver's blogging functionality is used.


    On most blogging site you will see options to like/tweet/share individual blog posts and I wanted to be able to have this for my blog as well.


    Instead of using the APIs from each of the individual providers, in my case Facebook, Twitter and Google+, I decided to make use of the API provided by AddThis. To incorparate AddThis into your site it requires a Javascript library to be loaded and pieces of HTML code to add the sharing buttons.


    For instance the following piece of HTML code generates a Facebook like button for on specific blog post.

    <a href="http://www.addthis.com/bookmark.php"
    class="addthis_button_facebook_like"
    fb:like:layout="button_count"
    addthis:url="http://www.littlegemsoftware.com/blog/files/wow-realms-15-submitted.php"
    addthis:title="WoW Realms 1.5 has been submitted"
    addthis:description="WoW Realms 1.5 has been submitted"></a>


    This piece of HTML code would then have to be added to every single blog post, where the attributes addthis:url, addthis:title and addthis:description would need to be changed to match the blog post you are adding the code to. But this piece of code is just for one social networking site, for Twitter and Google+ similar HTML code is required..... tailored for each blog post..... Uhm????


    I don't want to do this manually!

    Enter stage jQuery :)


    jQuery is a fast and concise JavaScript Library that simplifies HTML document traversing, event handling, animating, and Ajax interactions for rapid web development. jQuery is designed to change the way that you write JavaScript.


    Using jQuery the tedious manual (and error-prone) labour of adding the links and getting the attribute values correct for each blog post can be taken out of my hands.

    We just need to perform the following steps


    1. Add jQuery and AddThis libraries
    2. Add custom jQuery code
    3. Add custom CSS (some elements don't play nice and have to be put in their proper place)
    4. Add one line to each blog post entry


    Custom Header


    Add the following two lines of code as Custom Header (Page Inspector -> Header -> Header) of the blog page

    <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>  /* Load jQuery libraries */
    <script type="text/javascript" src="//s7.addthis.com/js/250/addthis_widget.js#pubid=xa-50362145480ab38a"></script> /* Load AddThis libraries */
    


    Custom Header



    jQuery

    This part is where all the magic happens. Add the following piece of JavaScript/jQuery code as Custom JavaScript (Page Inspector -> Header -> JavaScript) of the blog page

    $(document).ready( function() {
        $('div .social-badges').each( function( i, obj )
        {
            // Blog title and permalink (archive/main blog page)
            var permaLink = $(obj).closest('div .blog-entry').find('.blog-permalink');
            var blogTitle = permaLink.text();
            var blogLink = permaLink.prop('href');
    
            // Blog title and permalink (single post)
            if ( blogLink == undefined ) {
                blogTitle = $(obj).closest('div .blog-entry').find('.blog-entry-title').text();
                blogLink = $(location).attr('href');
            }
    
            // Insert AddThis links
            $(this).append( '<a href="http://www.addthis.com/bookmark.php" class="addthis_button_facebook_like" fb:like:layout="button_count" addthis:url="'+blogLink+'" addthis:title="'+blogTitle+'" addthis:description="'+blogTitle+'"></a>' );
            $(this).append( '<a href="http://www.addthis.com/bookmark.php" class="addthis_button_google_plusone" g:plusone:size="medium" addthis:url="'+blogLink+'" addthis:title="'+blogTitle+'" addthis:description="'+blogTitle+'"></a>' );
            $(this).append( '<a href="http://www.addthis.com/bookmark.php" class="addthis_button_tweet" addthis:url="'+blogLink+'" addthis:title="'+blogTitle+'" addthis:description="'+blogTitle+'"></a>' );
        });
    });
    


    Custom JavaScript

    If you want to know what this piece of jQuery is doing, jump to Dissecting the magic.

    Custom CSS


    Add the following piece of CSS code as Custom CSS (Page Inspector -> Header -> CSS) of the blog page

    .twitter-share-button { vertical-align: top; } /* Properly align tweet button */
    iframe { vertical-align: bottom; } /* Properly align Google+ button */
    div .social-badges { height: 30px } /* Fix issue with Chrome and Internet Explorer */
    


    Custom CSS

    Additional Blog post code

    Add the following piece of HTML code to each end of your blog posts.

    <div class="social-badges"></div>
    

    The jQuery code uses this piece of HTML code to;

    1. Determine title and permalink for the current blog post
    2. Insert the social sharing links

    Note: Be sure to apply 'Ignore Formatting' (⌘-.) to this piece of code (pink background color)


    Ignore Formatting

    End result


    After following these steps (and of course exporting the changes to the webserver) the sharing buttons get added to each of the individual blog post.

    Blog post within sharing buttons

    Dissecting the magic

    When the web page has loaded search locate all div-tags with the class social-badges

    $(document).ready( function() {
        $('div .social-badges').each( function( i, obj )
    


    Within the found div-tags locate the nearest div-tag with the class blog-entry and within that div-tag locate any tag with the class blog-permalink

    // Blog title and permalink (archive/main blog page)
    var permaLink = $(obj).closest('div .blog-entry').find('.blog-permalink');
    


    For the found tag (should be an ahref) get the text (being the blog post title) and href-property (the permalink of the post)

    var blogTitle = permaLink.text();
    var blogLink = permaLink.prop('href');
    


    In case the permalink is empty (we are on a page of the individual blog post itself), so we need to get document URL and the title somewhere else

    if ( blogLink == undefined ) {
        blogTitle = $(obj).closest('div .blog-entry').find('.blog-entry-title').text();
        blogLink = $(location).attr('href');
    }
    


    Insert the social sharing links using the AddThis API (adding blog post title and permalink)

    $(this).append( '<a href="http://www.addthis.com/bookmark.php" class="addthis_button_facebook_like" fb:like:layout="button_count" addthis:url="'+blogLink+'" addthis:title="'+blogTitle+'" addthis:description="'+blogTitle+'"></a>' );
    $(this).append( '<a href="http://www.addthis.com/bookmark.php" class="addthis_button_google_plusone" g:plusone:size="medium" addthis:url="'+blogLink+'" addthis:title="'+blogTitle+'" addthis:description="'+blogTitle+'"></a>' );
    $(this).append( '<a href="http://www.addthis.com/bookmark.php" class="addthis_button_tweet" addthis:url="'+blogLink+'" addthis:title="'+blogTitle+'" addthis:description="'+blogTitle+'"></a>' );
    



    Closing statement


    Before this I never really did anything with jQuery, but still was able to put this little gem to work fairly quickly….

    If you like this post, please share it with your friends using the sharing buttons below ;)

  • FAQ
    Frequently Asked Questions
    1. What happened to CEX Client [+]
      We have been contacted by CEX.IO that our application was violating copyright and trademark on their name and logo. Therefore we have renamed our application to Cloud Hash.
    2. CEX Client crashes when tapping refresh on the 'Revenue Calculator' [+]
      This happens when the keyboard is still showing. Tap on any label on the left part of the screen to dismiss the keyboard before tapping refresh. We have already submitted an update to Apple for review.
    3. What does the message "Nonce must be incremented" mean? [+]
      Every call to CEX.io must have an unique number and must be at least 1 higher since the previous call. CEX Client determines this number based on time. If you are using CEX Client on multiple devices it is good practice to generate different key/secret combinations for each device.
    4. I can't find the local currency I want to use [+]
      Apologies for not providing your local currency. Please go to our support/contact form and tell us which local currency you are missing so we can include it in a future release of CEX Client.
LGS Logo
Little Gem Software
Copyright © 2017 Little Gem Software. All Rights Reserved.