Recent Updates Page 5 RSS Toggle Comment Threads | Keyboard Shortcuts

  • Mohammad Jangda 1:01 pm on October 15, 2010 Permalink | Reply
    Tags: at-replies, email notifications, emails, , twitter   

    Twitter Tip: Email Notifications for @replies 

    Ever get one of those out-of-the-blue @replies? Someone off-handedly mentions you in a Tweet, but because you’re out-and-about, you don’t actually see it until you got back to your computer and fire up your favourite Twitter client. Wish you could find out instantly when someone @replies you?

    I wish I could I could say I that I was announcing an awesome new webapp to help you do just that (I made sketches for it and everything!) but turns out that Google (indirectly) beat me to it. (I guess their deal to buy Tweets is slowly paying off for users.)

    Enter Google Alerts.

    Setting up email alerts for @replies using Google Alerts

    Setting up email alerts for @replies using Google Alerts is easy

    If you’re already using Google Alerts to monitor keywords, this should be familiar territory.

    To set up an alert:

    1. Go to Google Alerts.
    2. For “Search terms” enter your username, e.g. @God_Damn_Batman
    3. Set “Type” to “Updates”.
    4. Set “How often” to “as-it-happens”.
    5. Set “Volume” to “All results”.
    6. If you’re signed in, your email should be populated. If not, enter your email address.
    7. Click “Create Alert”.

    …and that’s it.

    Google will now email you anytime you get an @reply, typically within a few seconds to a couple of minutes. (In most cases, it might even be faster than your Twitter client if it’s not Real-Time APIed yet and set to poll every 5+ minutes.)

    Google Alerts Email

    Google Alerts Updates Email are clean, fast, and useful

    Google adds the user’s profile pic, linkifies usernames and hashtags in the Tweet, and includes a permalink to the it. They’re even nice enough to expand shortened URLs from some of the popular services (e.g. bit.ly).

    Note: this likely won’t work for official retweets, only unofficial “RT”-style retweets (which are way cooler anyway). (2010-10-19: Turns out, the notifications work for official retweets as well!

    Bonus Tip: you can technically set up alerts for any term(s) you like. Try to be very specific though because if you pick an actively-talked-about topic you’re likely to get a constant barrage of emails.

    Extra Bonus Tip: If you want to stalk follow someone else’s tweets via email just set up an alert for their name (without the @ symbol), e.g. mjangda. Set up another one for @username and now you’re following everything that user is doing on Twitter. Yes, it’s creepy, so don’t actually do it.

     
  • Mohammad Jangda 11:59 pm on September 27, 2010 Permalink | Reply
    Tags: freshbooks, , hackto, idee, paywall, , ,   

    #hackTO v2.0: WP InstaPaywall 

    #hackTO the second happened this past Saturday (Sept 26, 2010), and like the first one, it was awesome. We got a fresh batch of APIs (though, some returning) to play with, way too much sugar, and a lot of new faces, but the formula was the same: 6-7 hours to hack together an app using one (or more) of the given APIs.

    The pressure was on: as former champion of #hackTO, I had to defend my title. I decided to go big with an ambitious idea, not totally sure if I’d be able to finish in the given time. I had originally come up with the idea at the first #hackTO, but didn’t really have time to implement so I put it on my projects-for-the-future list. But this time around figured I’d give it a shot and so the WordPress InstaPaywall plugin was born.

    Sadly, I didn’t reclaim my title but managed to score a third place entry. The judges apparently had a tough time deciding though, because there were a lot of really great apps developed.

    Now, onto the plugin!

    WP InstaPaywall

    Premise

    In its simplest form, the plugin lets you paywall your blog posts and make money by charging readers for full access to them. Paywalls are the new hotness these days and Freshbooks’ billing API seemed like a perfect fit for accomplishing this.

    Caveat

    I think it’s important to note that I hate paywalls. I hate freewalls even more (yes, NYTimes.com, I’m talking about you!). But, it’s a model that some people think will work (and are betting their futures on), and it clearly is working for some. So, while it pains me to build something that contributes to the paywall madness — I would much rather see everyone take a Guardian-like approach; the world would be a better place if we did — it doesn’t hurt to sip the kool-aid every once in a while.

    Plugin Walk-through

    The plugin basically takes a modified iTunes-like approach: 1-click buying that you’re billed for at the start of the month.

    It’s a bit difficult to run a demo, so I’ll just use screenshots instead.

    Note: The plugin is a bit rough around the edges and not quite as good-looking or elegant as I would like, but what do you expect in 6.5 hours?

    Enable Paywall

    WP InstaPaywall — Paywall Metabox

    WP InstaPaywall — Paywall Metabox

    The plugin adds a new metabox to the Edit Post screen, which let’s you enable the paywall for any given post. Once enabled, you can specify the amount that you would like to charge for the post.

    Users => Freshbooks

    WP InstaPaywall - Clients in Freshbooks

    WP InstaPaywall - Clients in Freshbooks

    All users in WordPress get an associated Client entry created in Freshbooks.

    Recurring Invoice

    All users in WordPress also get a Recurring Invoice entry created in Freshbooks. This is central to the application billing service in Freshbooks. This invoice is set to go out at the first of every month.

    Rack up charges

    WP InstaPaywall - A Paywalled Post

    WP InstaPaywall - A Paywalled Post

    Whenever a user encounters a paywalled post, they’re shown a message indicating they can view the full content by paying a given amount. If the user agrees to pay, the amount indicated is added as an entry to their Recurring Invoice.

    WP InstaPaywall - An Unlocked Post

    WP InstaPaywall - An Unlocked Post

    WP InstaPaywall - Upcoming Payments

    WP InstaPaywall - Upcoming Payments

    Charges for any given month add up. Users can view upcoming charges as well.

    WP InstaPaywall - Monthly Recurring invoice

    WP InstaPaywall - Monthly Recurring invoice

    On the first day of the following month, Freshbooks automatically emails the invoice to the user (Freshbooks has snail mail support if you want to go old school — though, this wasn’t integrated). Then, thanks to the magic of webhooks (and a just-in-case cron job), the user’s invoice entries are cleared so they have a clean slate for the next month.

    And then the cycle repeats.

    The Pipe Dream (aka Potential Improvements)

    My origin scope for the plugin was way bigger, but I just didn’t have enough time to implement everything. My main goal was to provide a three-pronged approach to paywalling to allow content creators the maximum flexibility. Some other ideas I had for payment models:

    • The Subscription Model: Pay a single fee on an ongoing basis (weekly? monthly?) and get access to all content on the site.
    • The Debit Model: Load up your account with money up-front and charge on a per-use basis
    • The (FB) Credit Model: Similar to The Debit Model, but using Facebook Credits instead of money.
    • The (True) Micropayments Model: Let users decide how much they want to pay, and allow content creators to set “suggested amounts”.

    Other improvements and crazy ideas:

    • Various Payment Periods: Options to select how often the user should be billed: Weekly, Monthly, Instantly?
    • Auto-billing: Rather than waiting till the end of the month for people to pay, integrate with Freshbooks’ autobilling support to charge their credit cards instantly.
    • Track and Suspend Deadbeats: If working with the “Pay me at the end of the month” model, add safeguards to monitor, suspend and harass people who fall behind on payments.
    • Authenticated RSS Feeds: This would only work with the subscription model.
    • Analytics: Probably the most important thing next the actual payment piece. Graphs and other metrics that tell you what content is being paid for, when, where, why, by whom, and so on.
    • Ditch Freshbooks? I love Freshbooks, but it’s way too expensive for Joe Blogger. For this plugin to work effectively, you’d need to get one of the higher-priced accounts which start at $30/month, which means you’d have to “sell” at least $30 worth of blog posts per month just to break even. It might be easier just to integrate directly with something like PayPal. But then again, Joe Blogger probably shouldn’t be paywalling his posts anyway…

    Code?

    Like most of my work (e.g. WordPress projects), I’m always happy to openly release the course code. However, the code for InstaPaywall in its current state is way too “unclean” to be release-worthy. When I get a chance, I’ll clean it up and open it up to the world.

    Other HackTO News

    Update (2010-11-01): I recently found out about Flattr which is an existing micro-payment platform for content creators. Very cool!

     
    • Tom Ransom 2:15 pm on September 30, 2010 Permalink | Reply

      Would love to see your code (in any state) as I just had a customer ask about the Freshbooks api for their site.

  • Mohammad Jangda 12:36 pm on September 18, 2010 Permalink | Reply
    Tags: css3, , mobile, mobileweb, presentation, vortex   

    FITC Mobile 2010 Presentation: HTML5, CSS3, and other fancy buzzwords 

    My presentation at FITC Mobile 2010 went better than I expected! The slides are embedded below and can be downloaded here.

    Note: the animations in the slideshare version don’t work.

    Also, check out some really dumbed down demos I made.

     
  • Mohammad Jangda 9:23 pm on September 13, 2010 Permalink | Reply
    Tags: ajax, callbacks, ,   

    WordPress Tip: Hooking into Widget Save Callback 

    John Gadbois turned some code I gave him into short and useful write-up on how to hook into AJAX calls triggered when saving widgets. It makes use of jQuery’s Global AJAX event handlers, which allow for some very cool things, especially when you’re working with external libraries that use the jQuery AJAX methods. A future blog post will cover how plugins can use the ajaxSend event to hook into WordPress’ autosave.

     
  • Mohammad Jangda 5:23 pm on July 22, 2010 Permalink | Reply
    Tags: , ,   

    jQuery Plugin: HTML5 Inline Data 

    HTML5 Data Attributes are sexy.

    What’s sexier is an easy way to work with these data attributes using jQuery.

    Sure, you could do something like:

    jQuery('#pancakes').attr('data-type');
    

    But who wants to type the “data-” prefix over and over again?

    So, here’s a quick little plugin I whipped up. It’s probably terrible when it comes to jQuery plugin standards (I do WordPress plugins, not jQuery), but it works. It works as a getter and setter.

    Bonus: If you’re using jQuery 1.4.1+, the plugin supports well-formed JSON objects as data attribute values.


    /*
    * Inline Data - get and set HTML5 data attributes! Yay!
    *
    * Copyright (c) 2010 Mohammad Jangda (http://digitalize.ca), Vortex Mobile (http://www.vortexmobile.ca)
    *
    * Licensed under the MIT license:
    * http://www.opensource.org/licenses/mit-license.php
    *
    */
    
    (function($) {
        $.fn.inlinedata = function(name, value) {
    
            var prefix = 'data-';
            var attr = prefix + name;
            var values = []
    
            this.each(function(i) {
                var attrValue;
    
                // Setting values
                if(value) {
                    // If an array is passed, the array index should correspond to the collection index
                    if($.isArray(value)) {
                        // Check, check, check the index. Because out of bounds exceptions are the devil!
                        if(typeof(value[i]) !== 'undefined')
                            attrValue = value[i];
                        else
                            attrValue = '';
                    } else {
                        // Not an array, so we're just giving all the elements the same value
                        attrValue = value;
                    }
                    this.setAttribute(attr, attrValue);
                } else {
                    // Getting values
                    attrValue = this.getAttribute(attr);
    
                    try {
                        // try parsing as JSON
                        attrValue = jQuery.parseJSON(attrValue);
                    } catch(e) { }
                }
                attrValue = (attrValue) ? attrValue : '';
                values.push(attrValue);
            });
    
            if(values.length == 1)
                return values[0]
    
            return values;
        }
    })(jQuery);
    

    Usage is simple:


    
    
    
    
    
    
    
    
    
    
    
    
    

     
  • Mohammad Jangda 12:39 pm on May 4, 2010 Permalink | Reply
    Tags: parks,   

    Photo: “A city within a park” 

    image

    Berczy Park (in Toronto) rocks.

     
  • Mohammad Jangda 12:34 pm on April 30, 2010 Permalink | Reply  

    Gettin’ gisty 

    I love gisthub.

     
  • Mohammad Jangda 3:36 pm on April 29, 2010 Permalink | Reply
    Tags: , , , , ,   

    JavaScript Tip: Save me from console.log errors 

    It’s bound to happen. You build yourself a sweet webapp with some sweet javascript action and you unleash it to the world only to get angry emails yelling, “IT DOESn’T WoRK! FIX iT okAy?” And it’s the darndest problem because it’s happening to both IE and Firefox users (Chrome and Safari users have been silent) and you can’t replicate it.

    And then you spend hours trying to figure out the problem to no avail, leaving you scratching that magnificent head of yours with luscious, flowing hair. You just can’t replicate the problem. But then, after hours and days of staring intently at the screen, you find it. It’s a rogue console.log call that you forgot to comment out. And then you spend the remainder of the week chastising yourself for being stupid.

    It happens. (To be fair, it’s not your fault that your users don’t have Firebug or IE Developer Tools installed. Blame it on Mozilla/Microsoft.)

    But there’s an easy solution. Just copy the following javascript somewhere in your project, and rest easy:


    if(typeof(console) === 'undefined') {
        var console = {}
        console.log = console.error = console.info = console.debug = console.warn = console.trace = console.dir = console.dirxml = console.group = console.groupEnd = console.time = console.timeEnd = console.assert = console.profile = function() {};
    }
    

     
    • Chris Marisic 3:38 pm on March 8, 2011 Permalink | Reply

      Nice article, I just came across this bug affecting orbit jquery slider and posted your article to them https://github.com/zurb/orbit/issues/6 :)

    • Jatinder Assi 3:52 pm on September 27, 2011 Permalink | Reply

      Actually the if stmt will always gets executed in IE 8, even when the developer tools window is open, thus resulting in the console object to be always a nul object.

      Instead here is the solution that I used after modifying your code:

      try
      {
      console.log('test');
      }
      catch(err){
      var console = {};
      console.log = console.error = console.info = console.debug = console.warn = console.trace = console.dir = console.dirxml = console.group = console.groupEnd = console.time = console.timeEnd = console.assert = console.profile = function() {};
      }

  • Mohammad Jangda 10:12 am on April 29, 2010 Permalink | Reply
    Tags: license, open source   

    On Licensing 

    I think I’ll be using this license for pretty much all my future work:

    All files in this repository are covered by the:

    DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
    Version 2, December 2004

    Copyright (C) 2004 Sam Hocevar

    Everyone is permitted to copy and distribute verbatim or modified copies of this license document, and changing it is allowed as long as the name is changed.

    DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION

    0. You just DO WHAT THE FUCK YOU WANT TO.

     
    • Suzie 11:43 am on May 11, 2010 Permalink | Reply

      Hee, well it would definitely be straight to the point! I approve.

  • Mohammad Jangda 12:35 pm on April 6, 2010 Permalink | Reply
    Tags: , html emails, ,   

    WordPress Plugin: HTML Emails 

    Tired of all those boring emails that you get from WordPress? Do you dread opening emails from WordPress because plain text and/or over-querystringified links terrify you? Rest easy friend, HTML emails for WordPress are here.

    HTML Emails replaces the standard WordPress emails with spruced up versions that simply look good. Sample included below:

    New Comment Notification as seen in Gmail

    Currently, only comment notifications are HTML-ized (new comment and comment moderation emails), but I’m hoping to add all other email notifications soon (and yes, that includes Multi-Site emails coming with WordPress 3.0).

    While I have only tested the emails on Gmail, Gmail on Android, and Outlook, they should work on most email clients (including clients without HTML support). If you’re using a client other than the 3 I’ve listed, I would appreciate an email with info on whether the email looks like it should and works correctly.

    Don’t like my design chops? (Go ahead, admit it!) I’ve got you covered! HTML emails makes it easy to fully customize the look and feel of emails sent by WordPress. See the Other Notes section on the Plugin page for details on how to customize emails. More detailed walkthroughs to come.

    Grab it from the Plugin Directory or install directly from WordPress (Plugins > Add New, search for HTML Emails).

     
    • Carlos 1:11 am on April 25, 2010 Permalink | Reply

      Hi, this looks amazing.

      How does it work in WPMU?

      • Mohammad Jangda 9:35 pm on April 29, 2010 Permalink | Reply

        I’m hoping to release a version that works with WordPress 3.0′s Multi-site feature.

    • Nick 5:45 am on May 11, 2010 Permalink | Reply

      Hi Mohammad,

      Great plugin – HTML works fine in all common email clients (Mail, Thunderbird, Outlook Express) on Windows and Mac’s as far as I’ve tested.

      I wonder – is there a way to change the “from” name and email address from wordpress@whateversite.com to a specified email address?

      That would be great.

      Thanks,

      Nick

    • Raoni 10:44 am on May 28, 2010 Permalink | Reply

      Hi,

      I have just translated your plugin into Portuguese Brazil. How can I send you??

      Can you include in the next version???

      And thanks for this GREAT plugin……….

      See ya!

      Raoni

    • Thomas Herold 9:25 pm on July 8, 2010 Permalink | Reply

      Hello Mohammad,

      Any chance to add html email for a user when they request a password reset and also get an email with the new password?

      Thomas

    • Brent Logan 10:27 pm on July 18, 2010 Permalink | Reply

      Nice plugin. Unfortunately, it doesn’t show the commenter’s URL. I need to know that before approving. After all, I wouldn’t approve *any* comment by someone with an URL like: http://nlrgurXXX.com

      • Mo Jangda 12:03 am on July 19, 2010 Permalink | Reply

        Thanks for your comment Brent!

        The commenter’s URL is actually included and linked form their name. But, this has actually thrown me off a few times too and it probably would be easier if the URL was listed separately. I’ll make sure to change that in the next release.

        • Brent Logan 7:22 am on July 19, 2010 Permalink | Reply

          Ha! So it is. That’s nice.

          I’m looking forward to your next release.

    • Sid 5:12 pm on July 22, 2010 Permalink | Reply

      I really liked your plugin . Emails were really sweet as you said instead of those ugly ones of WP.

      If possible add Password notications also in next version please.

      Thanks

    • Grawl 11:41 am on August 18, 2010 Permalink | Reply

      I have just translated in Russian the .pot file from the plugin archive with Poedit in MacOS, but it will show me #$%&@^& errors and cannot open it after saving into the .pot and .po files. But in text mode with any text editor it can be open, so that is translated file: http://cl.ly/716d0df1a6278c0dc052
      Maybe you can make it stable and include my translate into next version.
      Sorry for my bad English :3

    • Nico 9:33 am on September 22, 2010 Permalink | Reply

      Hi!

      Good plugin, I had the same idea but trying to make it work in a different.
      I’m running my WP installation in E_ALL error displaying and have some undefined constants. It’s a shame that there are so many great plugins but auhtors don’t care about notices. The whole WP publishing system runs whithout any notice ! Could you please correct it ? :)

    • LaTonya@ Internet Marketing for Small Businesses 1:55 pm on December 10, 2010 Permalink | Reply

      Ok this might be a really BASIC question, but how do I create an email?

      Stop laughing please;-)

    • cogniter 1:35 am on June 2, 2011 Permalink | Reply

      Any chance to add html email for a user when they request a password reset and also get an email with the new password?

c
compose new post
j
next post/next comment
k
previous post/previous comment
r
reply
e
edit
o
show/hide comments
t
go to top
l
go to login
h
show/hide help
shift + esc
cancel