22 Mayıs 2009 | 13:10
yazar: Guardian

WP Plugin: Google Shared Contents 1.0

Kategoriler: araçlar, yazılım, özgür yazılım
Etiketler: , , , , ,

I usually use Google Reader to share contents those I read. I thought I need a more usefull way to display them on samkon, because I can’t write about every content that I read and contents those display on my site should be more wellrounded than Google’s API that is currently seen at my sidebar. To make it usefull for everyone I wrote a plugin that’s called Google Shared Contents.

What is it?

It is a Wordpressplugin that displays the contents of your Google Reader acount’s sharings those you noted before by utilizing your Google ID.

If you don’t have a similar buton as seen in the screenshot above on your browser;

Login to your Google Reader acount and click “Notes” on left sidebar. Than you can drag and drop the sampled buton to any area you want on your browser. Or you can manually create a button has a location as below (pleace remove the line spaces):

javascript:var%20b=document.body;var%20GR________
bookmarklet_domain='http://www.google.com';if(b&
&!document.xmlVersion){void(z=document.createElement
('script'));void(z.src='http://www.google.com/reader/
ui/link-bookmarklet.js');void(b.appendChild(z));}else{}

If you don’t know your Google ID;

Login to your Google Reader acount and click “shared items” on left sidebar. Than you will see a link that has a path to contents you shared before as below:

http://www.google.com/reader/shared/06800100454687167248

The equivalent data in path you get to bolded data above is your Google ID.

How to Install ?

  • download google-sharings.zip file and unzip it. Than put the unziped folder into “wp-content/plugins/” folder.
  • activate the plugin from your WP control panel.
  • Type your Google ID and the content count number will be displayed on your site by clicking “Options“, than “Google Sharings” from your control panel.
  • than modify your theme’s any file (depending on your choose where to display it) you want by adding the lines below:
<?php if (function_exists('load_google_sharings')) {
load_google_sharings('defined'); } ?>

Clues

  • You may want to use the plugin on more than one area on your site. So you may want to have different content count number for different areas on your site. You can use the count number you want instead of “defined” expression seen above. For example if you want to display last 5 shared contents you can use these lines seen below:
<?php if (function_exists('load_google_sharings')) {
load_google_sharings('5'); } ?>

In this way plugin will skip the default count number you typed in your control panel and use the expression you give in function.

Warnings

The most important thing: You can get trouble with PHP 4 versions. Plugin may not work. This site runs on a PHP 4 server and a reason that I couldn’t solve yet causes fail. I will give more information about that when I try it on different PHP 4 servers. Also If you try and tell me the result I will be glad.

Plugin uses SimpleXML libraries that is supported by PHP 5. Nothing went wrong with it yet. So I will move samkon to a PHP 5 server in a short time becouse of that.

Download

google-sharings.zip [3 KB]

Your comments and ideas about will help to develope the plugin, and all of them are wellcome..

4.960 defa okundu | Yorum Yaz

5 adet yorum var

  • [...] Originally posted here: WP Plugin: Google Shared Contents 1.0 [...]

  • Hi, and thank you so much for this plugin. It’s impressive: there’s no customization for google reader shared items, although is WAY THE BEST use of RSS…
    i’m using it here (http://www.pasife.net/news) and sometimes i get the “içerik belirtilmemiş” message. I don’t know the language, can you tell me what does it means?
    Thank You in advance

  • Hi Alfonso;

    Thank you for your message. Sorry for script has no language support yet.

    “İçerik belirtilmemiş” means there is no content to show. So this appears when there is no text in the content of shared item.

    When you open shared-contents.php you can see this message on line 54. And you can edit it as you want.

    İf you get any problem to edit, I am here.. See you..

  • Thank you for the quick answer!
    Using the google translator (after several mistakes, because i kept choosing the wrong language :P) i found out what it was…
    It’s because of some feed i have, which uses summaries. Here’s how i modified two “if” of yours.

    At line “58″ (sorry, i use the editor inside wordpress which wordwraps…) of shared-contents.php

    if ($entry->content) {
    echo"".$entry->content."..";
    }else{
    echo"".$entry->summary."..";
    }

    And again at line “135″:

    if ($g_content) {
    echo"". $g_content ."..";
    } else {
    echo"". $g_summary ."..";
    }

    I’m not an expert in php so maybe there’s a cleaner solution. This one works good for me.
    Thanks again.

    Alf

  • tşk.Bir sorum var?
    Son zamanlarda google arama motorunun yenliklerinden biri chrome. Google arama sonuçlarında yeni ve yararlı sonuçları da veriyor. Ve buda internetin dünyayı giderek küçültmesini ve kendini giderek büyültmesinin bir göstergesi. Google chrome arama motorunun şöyle bir özelliği var daha önce ilgilendiğin web sitelerini arama sonuçlarında öne çıkarması. Örneğin daha ince ziyaret ettiğim bir site var. Sonra google chrome den bu istenin de anahtar kelimesi olan bir kelime arattığımda google chrome bu siteyi ön sıralarda gösteriyor. Burada benim yaşadığım sıkıntı: anahtar kelimesi ‘özel ders’ olan BogaziciDers.com sitensin hangi sırada olduğunu öğrenmek istenildiğinde doğru sonucu vermemesi. BogaziciDers.com sitesini daha önce ziyaret ettiğim için onu öne çıkarıyor olması.

Cevap yazın

* kararkteri ile işaretlenmiş alanların doldurulması zorunludur.

Share/Save/Bookmark