Readability

Offline Nathan Sparrow

  • Friends
  • Posts: 1,096
  • Switched Chrome Canary to Chromium for Nightly builds.:
    • View profile
    • The iApple Cafe
Readability
« on November 17th, 2011, 08:28 AM »
Just became a fan of Readability recently after they announced a revamped reading platform.
http://blog.readability.c…cing-the-new-readability/


Readability — Read comfortably anytime, anywhere.


Hope someone can make this simple plugin: http://www.readability.com/publishers/tools

Am planning to request one over sm.org...

 Screen Shot 2011-11-17 at 3.27.46 AM.png (30.53 kB, 622x296 - viewed 208 times.)
“I will stand on my ground as an atheist until your god shows up...If my irreligious bothers you much, and if you think everything I do is heresy to your god I don't care. Heresy is for those who believe, I don't. So, it isn't heresy at all!


   Jack in, Wedge,
   EXECUTE![/b]

Online Arantor

  • Wedgeward
  • Posts: 10,364
  • The Twelve Tasks of Asterix is awesome.
    • View profile
    • Innovate, not Imitate
Re: Readability
« Reply #1 on November 17th, 2011, 08:53 AM »
Pffft, writing this plugin should take a short amount of time; if it takes any more than 15 minutes in SMF, it's being done wrong.

Wedge on the other hand has to tackle it slightly differently, because their embed code is... um... unusual and I'm not entirely clear why it's being done the way it is. It's still probably 15 minutes but I need to test it to make sure it won't break anything else.

(That's using the basic integration. Using the full on API is naturally more complex.)
   computer-aided
   community building
             

Other stuff:

Offline Nathan Sparrow

  • Friends
  • Posts: 1,096
  • Switched Chrome Canary to Chromium for Nightly builds.:
    • View profile
    • The iApple Cafe
Re: Readability
« Reply #2 on November 18th, 2011, 06:30 PM »
This is what I did:
Load.php

Code: [Select]
if (!isset($_REQUEST['xml']))
{
    $layers = $context['template_layers'];
    $context['template_layers'] = array();
           
    foreach ($layers as $layer)
    {
        $context['template_layers'][] = $layer;
                if ($layer == 'body' || $layer == 'main')
                    $context['template_layers'][] = 'Readability';
    }
}

Code: [Select]
/*This is where Readability button will be*/
function template_Readability_above()
{
echo'
<div class="rdbWrapper" data-show-read="1" data-show-send-to-kindle="1" data-show-print="0" data-show-email="0" data-orientation="0" data-version="1"></div><script type="text/javascript">(function() {var s = document.getElementsByTagName("script")[0],rdb = document.createElement("script"); rdb.type = "text/javascript"; rdb.async = true; rdb.src = document.location.protocol + "//www.readability.com/embed.js"; s.parentNode.insertBefore(rdb, s); })();</script>';
}
function template_Readability_below(){/*or here to show at the bottom*/}
/*End Readability button*/

Trying to add more social buttons that way, echoing them will results in a duplicate butons. :/
“I will stand on my ground as an atheist until your god shows up...If my irreligious bothers you much, and if you think everything I do is heresy to your god I don't care. Heresy is for those who believe, I don't. So, it isn't heresy at all!


   Jack in, Wedge,
   EXECUTE![/b]

Online Arantor

  • Wedgeward
  • Posts: 10,364
  • The Twelve Tasks of Asterix is awesome.
    • View profile
    • Innovate, not Imitate
Re: Readability
« Reply #3 on November 18th, 2011, 06:31 PM »
How exactly are you trying to add more social buttons?
   computer-aided
   community building
             

Other stuff:

Offline Nathan Sparrow

  • Friends
  • Posts: 1,096
  • Switched Chrome Canary to Chromium for Nightly builds.:
    • View profile
    • The iApple Cafe
Re: Readability
« Reply #4 on November 18th, 2011, 06:39 PM »
Quote from Arantor on November 18th, 2011, 06:31 PM
How exactly are you trying to add more social buttons?
$context['template_layers'] then function template.

Yeah I'm doing it wrong. :P
“I will stand on my ground as an atheist until your god shows up...If my irreligious bothers you much, and if you think everything I do is heresy to your god I don't care. Heresy is for those who believe, I don't. So, it isn't heresy at all!


   Jack in, Wedge,
   EXECUTE![/b]

Online Arantor

  • Wedgeward
  • Posts: 10,364
  • The Twelve Tasks of Asterix is awesome.
    • View profile
    • Innovate, not Imitate
Re: Readability
« Reply #5 on November 18th, 2011, 06:40 PM »
Just add it into the one template layer that you're adding in that loop.
   computer-aided
   community building
             

Other stuff:

Offline Nathan Sparrow

  • Friends
  • Posts: 1,096
  • Switched Chrome Canary to Chromium for Nightly builds.:
    • View profile
    • The iApple Cafe
Re: Readability
« Reply #6 on November 18th, 2011, 06:54 PM »
Not sure what you mean...

Code: [Select]
if (!isset($_REQUEST['xml']))
{
    $layers = $context['template_layers'];
    $context['template_layers'] = array();
           
    foreach ($layers as $layer)
    {
        $context['template_layers'][] = $layer;
                if ($layer == 'body' || $layer == 'main')
                    $context['template_layers'][] = 'Readability';
                    $context['template_layers'][] = 'Facebook';
                    $context['template_layers'][] = 'Twitter'; 
    }
}
“I will stand on my ground as an atheist until your god shows up...If my irreligious bothers you much, and if you think everything I do is heresy to your god I don't care. Heresy is for those who believe, I don't. So, it isn't heresy at all!


   Jack in, Wedge,
   EXECUTE![/b]

Online Arantor

  • Wedgeward
  • Posts: 10,364
  • The Twelve Tasks of Asterix is awesome.
    • View profile
    • Innovate, not Imitate
Re: Readability
« Reply #7 on November 18th, 2011, 07:02 PM »
The if is only conditional for the first line without braces, the other lines are going to run every time.

Code: [Select]
if (!isset($_REQUEST['xml']))
{
    $layers = $context['template_layers'];
    $context['template_layers'] = array();
           
    foreach ($layers as $layer)
    {
        $context['template_layers'][] = $layer;
        if ($layer == 'body' || $layer == 'main')
        {
            $context['template_layers'][] = 'Readability';
            $context['template_layers'][] = 'Facebook';
            $context['template_layers'][] = 'Twitter';
        }
    }
}
   computer-aided
   community building
             

Other stuff:

Offline Nathan Sparrow

  • Friends
  • Posts: 1,096
  • Switched Chrome Canary to Chromium for Nightly builds.:
    • View profile
    • The iApple Cafe
Re: Readability
« Reply #8 on November 18th, 2011, 07:30 PM »
Can't seem to add more than 2 function template. Must be missing something.

Code: [Select]
/*This is where GPlus button will be*/
function template_GPlus_above()
{
            echo'
<g:plusone size="medium" annotation="inline"></g:plusone>';
}
function template_GPlus_below(){/*or here to show at the bottom*/}
/*End GPlus button*/

/*This is where Readability button will be*/
function template_Readability_above()
{
echo'
<div class="rdbWrapper" data-show-read="1" data-show-send-to-kindle="1" data-show-print="0" data-show-email="0" data-orientation="0" data-version="1"></div><script type="text/javascript">(function() {var s = document.getElementsByTagName("script")[0],rdb = document.createElement("script"); rdb.type = "text/javascript"; rdb.async = true; rdb.src = document.location.protocol + "//www.readability.com/embed.js"; s.parentNode.insertBefore(rdb, s); })();</script>';
}
function template_Readability_below(){/*or here to show at the bottom*/}
/*End Readability button*/

/*This is where Facebook button will be*/
function template_Facebook_above(){/*or here to show at the bottom*/}
function template_Facebook_below(){/*or here to show at the bottom*/}
/*End Facebook button*/

/*This is where Twitter button will be*/
function template_Twitter_above()
{
echo'
<a href="https://twitter.com/share" class="twitter-share-button" data-count="horizontal" data-via="iapplecafe">Tweet</a><script type="text/javascript" src="//platform.twitter.com/widgets.js"></script>';
}
function template_Twitter_below(){/*or here to show at the bottom*/}
/*End Twitter button*/
“I will stand on my ground as an atheist until your god shows up...If my irreligious bothers you much, and if you think everything I do is heresy to your god I don't care. Heresy is for those who believe, I don't. So, it isn't heresy at all!


   Jack in, Wedge,
   EXECUTE![/b]

Online Arantor

  • Wedgeward
  • Posts: 10,364
  • The Twelve Tasks of Asterix is awesome.
    • View profile
    • Innovate, not Imitate
Re: Readability
« Reply #9 on November 18th, 2011, 07:56 PM »
Code looks fine to me.
   computer-aided
   community building
             

Other stuff:

Offline Nathan Sparrow

  • Friends
  • Posts: 1,096
  • Switched Chrome Canary to Chromium for Nightly builds.:
    • View profile
    • The iApple Cafe
Re: Readability
« Reply #10 on November 18th, 2011, 07:58 PM »
Quote from Arantor on November 18th, 2011, 07:56 PM
Code looks fine to me.
I know right, adding more than 2 functions bring my site down. Currently using 2 for now. :/
“I will stand on my ground as an atheist until your god shows up...If my irreligious bothers you much, and if you think everything I do is heresy to your god I don't care. Heresy is for those who believe, I don't. So, it isn't heresy at all!


   Jack in, Wedge,
   EXECUTE![/b]

Online Arantor

  • Wedgeward
  • Posts: 10,364
  • The Twelve Tasks of Asterix is awesome.
    • View profile
    • Innovate, not Imitate
Re: Readability
« Reply #11 on November 18th, 2011, 07:58 PM »
Contents of error log?
   computer-aided
   community building
             

Other stuff:

Offline Nathan Sparrow

  • Friends
  • Posts: 1,096
  • Switched Chrome Canary to Chromium for Nightly builds.:
    • View profile
    • The iApple Cafe
Re: Readability
« Reply #12 on November 18th, 2011, 08:11 PM » Last edited on November 18th, 2011, 09:18 PM by ~DS~
None. :/
Other than 500 or 404 for files that does not exist. (cPanel)


:edit: DUH! It was a conflit with the FB mod. So I removed the code. No point in doing so because it require JavaScript SDK which is complicated. :/
“I will stand on my ground as an atheist until your god shows up...If my irreligious bothers you much, and if you think everything I do is heresy to your god I don't care. Heresy is for those who believe, I don't. So, it isn't heresy at all!


   Jack in, Wedge,
   EXECUTE![/b]

Offline Nathan Sparrow

  • Friends
  • Posts: 1,096
  • Switched Chrome Canary to Chromium for Nightly builds.:
    • View profile
    • The iApple Cafe
Re: Readability
« Reply #13 on November 19th, 2011, 06:16 AM »
Back on topic, I was reading through https://www.readability.com/publishers/

It says you earn 70% when reader read a article using Readability on your site, am I correct?
“I will stand on my ground as an atheist until your god shows up...If my irreligious bothers you much, and if you think everything I do is heresy to your god I don't care. Heresy is for those who believe, I don't. So, it isn't heresy at all!


   Jack in, Wedge,
   EXECUTE![/b]

Online Nao

  • Wedgeward
  • Posts: 10,276
  • Reality check: I just discovered that Wedge already has a 'Mark unread' button for PMs, a feature in my to-do. Uh. It just isn't in the 'right' place...
    • View profile
    • Cynacittà @ noisen
Re: Readability
« Reply #14 on November 19th, 2011, 11:09 PM »
What exactly does that service provide?
  I say Wedge Wedge (in the butt)
« Everyone knows rock attained perfection in 1974. It's a scientific fact. » (Homer Simpson)