HotTech News from TOP Tech Sources

Recalling my last post—yes! I have published an Android app on the market! If you have an Android device, install and play…What is it about? Here it is:

Reading Tech News

Just any Tech news? Nope—TOP Tech news in real time! I included all the features that were missing from an android app that I found. Now it’s up to you to tell me what other features you would like to see in this simple and easy-to-use application.

The first release offers you the following features:

-       Techmeme Top News AND Hacker News
-       Super readable content
-       Sharing made easy with shortened URLs
-       Compatible with any Android mobile and tablet devices

And much more…

Check it out: Download the App

Posted in Android, For me, Google | Tagged , | Leave a comment

Getting ‘Techmeme’ Top News

One of the questions from quora is like this “Techmeme: Can the “top news” rss feed still be accessed or brought back?

I went to that question after searching a solution for “How to get techmeme top news”.  Why, techmeme doesn’t have rss for top news? No, it probably had before, but currently they don’t.  They have rss for the tech news, which is kind of, mix of recent news, top news etc.

Techmeme is one of those websites I visit everyday, doesn’t matter how busy I’m. It’s one of my favourite sites without any doubt. As I read it everyday, I wanted to make it easier for myself to read and share, and to do that I needed RSS for top news.

Since the time I realized there was no way to get rss for techmeme top news, I started looking for alternatives. And yes, finally I have found a way to get techmeme TOP news using simple “Simple html dom”. Techeme has mini page and one of the sections contains top news. That’s it! All we need is to dig for correct information. Have a look at the little hack…

< ?php
include_once('../simple_html_dom.php');
// Create DOM from URL or file
$html = file_get_html('http://techmeme.com/mini');
$list = array();
$i = 0;
foreach ($html->find('div.mini_item') as $element) {
    /*
     * first 14 news are top news
     */
    if($i< =13) {
        if(isset($element->find('a', 0)->class) && $element->find('a', 0)->class=='mini_head') {
            if($element->previousSibling(0)->innertext == 'RELATED:') {
                $output['List'][$i]['from']   = $element->childNodes(0)->innertext.' (RELATED)';
            }else {
                $output['List'][$i]['from']   = $element->childNodes(0)->innertext;
            }
            $output['List'][$i]['title']   = $element->find('a', 0)->innertext;
            $output['List'][$i]['link']  = $element->find('a', 0)->href;
           $i++;
        }
        else if (isset($element->find('div', 0)->class) || isset($element->find('a div', 1)->class)) {
            if($element->previousSibling(0)->innertext == 'RELATED:') {
                $output['List'][$i]['from']   = $element->childNodes(0)->innertext.' (RELATED)';
            }else {
                $output['List'][$i]['from']   = $element->childNodes(0)->innertext;
            }
            $output['List'][$i]['title']   = $element->find('div a', 0)->innertext;
            $output['List'][$i]['link']  = $element->find('div a', 0)->href;
            $i++;
        }
   }
}
if (empty($output['List'])) {
    $output['List']['msg'] = 'No Result Found';
}
 
print(json_encode($output));
exit();

You can get full source code from this link
Let me know if you have any questions. Have better idea to improve it?

Now I’m going to take it a little further. What’s that? Stay tune…

Posted in PHP, Technology, Web | Tagged , , , | 3 Comments