why do you need a service like bankinfobd.com? Currently, all banks operating in Bangladesh has their own website. Among them only few banks updates their website regularly, not all banks have all products or service information on their websites and some are really outdated. For great banking and loan options visit wecu.com/personal-banking/vehicle-loans/.
Moreover, each bank website, however comprehensive the services are, has different information structure and user interface to serve information. So, if you want to find a specific information, say Car Loan, you have to go to different banks website and browse one by one in different ways or you can ask the banker the next time you start a banking account. This way you can hardly get 5 to 6 banks car loans information wasting a big amount of time. If you are a veteran you can apply for an in va home loans for veterans, this will help you save and give you lower interest rates. We are making this process easier with our Car Loan section, where you can get all banks who have Car Loans and browse one by one easily, if you feel more information then you can always visit the banks website.
“Time is important”, For bankers and people related to banking sector, we are serving latest banking news & event information in our news section, so you can now get updated in few minutes.
We also have a career section where we are putting tips and articles for novice bankers and also for those who are planning for banking career. Hope, this is going to be a great knowledge center for banking in near future, since banking is important right now, and banking systems are essential, since this give you a second chance bank account is a version of a standard checking account offered by a financial institution.
Our banking blog section is open for all. It will help us to know more about in and out of our banking sector. Whether you are a banker or student, if you have a great article on Banking or you want to share ur banking experience, which you feel helpful for other, please write or email us at info.[at].bankinfobd.com, we will publish with your name and reference, although if what you need is to get a loan, you can totally use different alternatives and banking options.
Features of BankInfoBD.com
Its one month, BankInfoBD.com is live on the internet. From the very beginning, we are getting excellent response from all and now we are more encouraged to work hard on it. Soon, we will come up with more ideas and information in this portal.
]]>
If you find my presentation helpful for you, please rate my slides at SpeakerRate.com.
More about the seminar:
]]>First of all it’s another reinvention of wheel. This class is designed to provide quick access to any XML based RSS feed and it’s content. Usages are very simple and require only one line of code. Html rendering functionality is provided through separate pluggable widget rendering class which can be extended easily. SimpleXML is used by default to load and fetch feed url but can be used CURL using rayHttp class. All or any CURL options can be set for HTTP request. It can auto detect feed type and supports RSS 0.92, RSS 2.0 and Atom feeds.
Features:
- Read feeds content into an array
- Supports for RSS 0.92, RSS 2.0 and Atom feed
- Detect feed type automatically, also can be set manually.
- Support pluggable html widget rendering class
- Can render html widget through optional RayFeedWidget class or your own extended class.
- Easily configurable & can work without any configuration.
- Simple & Easy to use from anywhere in your application with a single line of code.
- Support Singleton pattern
- By default SimpleXML is used as http client,
- Support Custom CURL request, may be used to extends functionality through rayHttp class.
- Light Weight
Methods Available (This class provides):
- parse()
- getData()
- widget()
Class:
File: rayfeedreader.php
<?php
/**
* RayFeedReader
*
* SimpleXML based feed reader class. A very specific feed reader designed
* to working with no or little configurations.
*
* - This class can read an rss feed into array from a given url.
* - Also can render html widget with plugable RayFeedWidget Class.
*
* Supports following feed types:
* - RSS 0.92
* - RSS 2.0
* - Atom
*
* Configuration Options
* - array
* - url: (string)
* - feed url
*
* - httpClient: (string)
* - default SimpleXML
* - value rayHttp or SimpleXML
*
* - type: ([optional] string
* - auto detect
* - value rss or rss2 or atom
*
* - widget: ([optional] string)
* - feed widget class name for rendering html
*
* - rayHttp: (array)
* - only if httpClient is set to rayHttp
* - rayHttp Options if you want to modify rayHttml CURL options
* - generally not required.
*
*
*
*
* @version 1.0
* @author Md. Rayhan Chowdhury
* @package rayFeedReader
* @license GPL
*/
Class RayFeedReader{
/**
* Self Instance for Singleton Pattern
*
* @var object
* @access protected
*/
static private $__instance;
/**
* Instance of Parser Class.
*
* @var object Parser Class
* @access protected
*/
Protected $_Parser;
/**
* Feed Url
*
* @var string feed url
* @access protected
*/
protected $_url;
/**
* Runtime Options for reader
*
* @var array
* @access protected
*/
protected $_options = array('rayHttp' => array());
/**
* Type of feed to be parsed.
*
* @var string
* @access protected
*/
protected $_type = "rss";
/**
* HttpClient to be used for loading feed content.
*
* - default SimpleXML
*
* @var string 'SimpleXML' or 'rayHttp'
* @access protected
*/
protected $_httpClient = "SimpleXML";
/**
* Widget Class Name
*
* @var string
* @access protected
*/
protected $_widget;
/**
* Parsed result data
*
* @var array
* @access protected
*/
protected $_content;
/**
* Class construct
*
* @param array $options
*/
function __construct($options = array()) {
$this->setOptions($options);
}
/**
* Get Instance of the class.
*
* @param array $options
* @return object self instance.
* @access public
* @static
*/
static function &getInstance($options = array()) {
if (is_null(self::$__instance)) {
self::$__instance = new self($options);
}
return self::$__instance;
}
/**
* Set Options for the class
*
*
* @param array $options
* @return object self instance
* @access public
*/
function &setOptions($options) {
if (!empty($options['url'])) {
$this->_url = $options['url'];
}
if (!empty($options['type'])) {
$this->_type = $options['type'];
}
if (!empty($options['httpClient'])) {
$this->_httpClient = $options['httpClient'];
}
if (!empty($options['widget'])) {
$this->_widget = $options['widget'];
}
$this->_options = array_merge($this->_options, $options);
return $this;
}
/**
* Parse feed contents into an array and return self object
*
* @return object self instance
* @access public
*/
function &parse() {
/**
* Get/load content
*/
switch ($this->_httpClient) {
case 'SimpleXML':
$content = new SimpleXMLElement($this->_url, LIBXML_NOCDATA, true);
break;
case 'rayHttp':
$content = RayHttp::getInstance()->setOptions($this->_options['rayHttp'])->get($this->_url);
if (!empty($content)) {
$content = new SimpleXMLElement($content, LIBXML_NOCDATA);
}
break;
}
if (empty($content)) {
trigger_error("XML format is invalid or broken.", E_USER_ERROR);
}
/**
* Detect Feed Type
*/
if (empty($this->_type)) {
switch ($content->getName()) {
case 'rss':
foreach ($content->attributes() as $attribute) {
if ($attribute->getName() == 'version') {
if ('2.0' == $attribute) {
self::setOptions(array('type' => 'rss2'));
} elseif (in_array($attribute, array('0.92', '0.91'))) {
self::setOptions(array('type' => 'rss'));
}
}
}
break;
case 'feed':
self::setOptions(array('type' => 'atom'));
break;
}
}
if (!in_array($this->_type, array('rss', 'rss2', 'atom'))) {
trigger_error("Feed type is either invalid or not supported.", E_USER_ERROR);
return false;
}
/**
* Parse Feed Content
*/
switch ($this->_type) {
case 'rss':
$content = $this->parseRss($content);
break;
case 'rss2':
$content = $this->parseRss2($content);
break;
case 'atom':
$content = $this->parseAtom($content);
break;
}
if (empty($content)) {
trigger_error("No content is found.", E_USER_ERROR);
}
$this->_content = $content;
return $this;
}
/**
* Get Array of Parsed XML feed data.
*
* @return array parsed feed content.
* @access public
*/
function getData() {
return $this->_content;
}
/**
* Return html widget based rendered by widget class
*
*
* @param array $options for html widget class
* @return string html widget
* @access public
*/
function widget($options = array('widget' => 'brief')) {
if (!empty($this->_widget) && !empty($this->_content)) {
$Widget = new $this->_widget;
return $Widget->widget($this->_content, $options);
} else {
return false;
}
}
/**
* Parse feed xml into an array.
*
* @param object $feedXml SimpleXMLElementObject
* @return array feed content
* @access public
*/
function parseRss($feedXml) {
$data = array();
$data['title'] = $feedXml->channel->title . '';
$data['link'] = $feedXml->channel->link . '';
$data['description'] = $feedXml->channel->description . '';
$data['parser'] = __CLASS__;
$data['type'] = 'rss';
foreach ($feedXml->channel->item as $item) {
$data['items'][] = array(
'title' => $item->title . '',
'link' => $item->link . '',
'description' => $item->description . '',
);
}
return $data;
}
/**
* Parse feed xml into an array.
*
* @param object $feedXml SimpleXMLElementObject
* @return array feed content
* @access public
*/
function parseRss2($feedXml) {
$data = array();
$data['title'] = $feedXml->channel->title . '';
$data['link'] = $feedXml->channel->link . '';
$data['description'] = $feedXml->channel->description . '';
$data['parser'] = __CLASS__;
$data['type'] = 'rss2';
$namespaces = $feedXml->getNamespaces(true);
foreach ($namespaces as $namespace => $namespaceValue) {
$feedXml->registerXPathNamespace($namespace, $namespaceValue);
}
foreach ($feedXml->channel->item as $item) {
$categories = array();
foreach ($item->children() as $child) {
if ($child->getName() == 'category') {
$categories[] = (string) $child;
}
}
$author = null;
if (!empty($namespaces['dc']) && $creator = $item->xpath('dc:creator')) {
$author = (string) $creator[0];
}
$content = null;
if (!empty($namespaces['encoded']) && $encoded = $item->xpath('content:encoded')) {
$content = (string) $encoded[0];
}
$data['items'][] = array(
'title' => $item->title . '',
'link' => $item->link . '',
'date' => date('Y-m-d h:i:s A', strtotime($item->pubDate . '')),
'description' => $item->description . '',
'categories' => $categories,
'author' => array( 'name' => $author),
'content' => $content,
);
}
return $data;
}
/**
* Parse feed xml into an array.
*
* @param object $feedXml SimpleXMLElementObject
* @return array feed content
* @access public
*/
function parseAtom($feedXml) {
$data = array();
$data['title'] = $feedXml->title . '';
foreach ($feedXml->link as $link) {
$data['link'] = $link['href'] . '';
break;
}
$data['description'] = $feedXml->subtitle . '';
$data['parser'] = __CLASS__;
$data['type'] = 'atom';
foreach ($feedXml->entry as $item) {
foreach ($item->link as $link) {
$itemLink = $link['href'] . '';
break;
}
$categories = array();
foreach ($item->category as $category) {
$categories[] = $category['term'] . '';
}
$data['items'][] = array(
'title' => $item->title . '',
'link' => $itemLink . '',
'date' => date('Y-m-d h:i:s A', strtotime($item->published . '')),
'description' => $item->summary . '',
'content' => $item->content . '',
'categories' => $categories,
'author' => array('name' => $item->author->name . '', 'url' => $item->author->uri . ''),
'extra' => array('contentType' => $item->content['type'] . '', 'descriptionType' => $item->summary['type'] . '')
);
}
return $data;
}
}
?>
External feed widget class to get rendered html widget.
File: rayfeedwidget.php
<?php
/**
* Feed Widget Interface
*
* @version 1.0
* @author Md. Rayhan Chowdhury
* @package rayFeedReader
* @license GPL
*/
interface RayFeedWidget_Interface{
/**
* Public widget method
*
* @param <type> $data
* @param $options
* @return string html
*/
public function widget($data, $options = array());
}
/**
* Widget Plugin Class for RayFeedReader
*
* Render html widget for feed reader based on options
*
* config options
* - array
* - widget:
* - optional string
* - value 'brief' or 'compact' or 'detail'
* - showTitle
* - boolean
* - whether add blog title or not.
*
* @version 1.0
* @author Md. Rayhan Chowdhury
* @package rayFeedReader
* @license GPL
*/
class RayFeedWidget implements RayFeedWidget_Interface{
/**
* HTML widget structure
*
* @var array
* @access public
*/
public $html = array('brief' => "<div class=\"feed-item feed-brief\">\n
<div class=\"feed-item-title\">\n
<h3><a href='%s'>%s</a></h3>\n
<div class='feed-item-date'>%s</div>\n
</div>\n
<div class=\"feed-item-description\">%s</div>\n
</div>",
'compact' => "<div class=\"feed-item feed-compact\">\n
<div class=\"feed-item-title\">\n
<h3><a href='%s'>%s</a></h3>\n
<div class='feed-item-date'>%s</div>\n
</div>\n
</div>",
'detail' => "<div class=\"feed-item feed-detail\">\n
<div class=\"feed-item-title\">\n
<h3><a href='%s'>%s</a></h3>\n
<div class='feed-item-date'>%s</div>\n
</div>\n
<div class=\"feed-item-content\">%s</div>\n
</div>",
);
/**
* Return html widget based rendered by widget class
*
* @param $data
* @param $options
* @return
*/
function widget($data, $options = array('widget' => 'brief')) {
switch ($options['widget']) {
case 'compact':
return $this->widgetCompact($data, $options);
break;
case 'detail':
return $this->widgetDetail($data, $options);
break;
case 'brief':
default:
return $this->widgetBrief($data, $options);
break;
}
}
/**
* Render feed widget with title and date only
*
* @param $data
* @param $options
* @return
*/
function widgetCompact($data, $options = array()) {
if (empty($data['items'])) {
return false;
}
$out = array();
foreach ($data['items'] as $item) {
if (empty($item['date'])) {
$item['date'] = '';
}
$out[] = sprintf($this->html['compact'], $item['link'], $item['title'], $item['date']);
}
$title = '';
if (empty($options['showtitle'])) {
$title = sprintf("<div class='feed-title'><h2>%s</h2><hr>%s</div>\n", $data['title'], $data['description']);
}
$out = "<div class='feed-container'>\n" . $title . join(" \n", $out) . "</div>";
return $out;
}
/**
* Render feed widget with title, date & description
*
* @param $data
* @param $options
* @return
*/
function widgetBrief($data, $options = array()) {
if (empty($data['items'])) {
return false;
}
$out = array();
foreach ($data['items'] as $item) {
if (empty($item['date'])) {
$item['date'] = '';
}
if (empty($item['description'])) {
$item['description'] = $item['content'];
}
$out[] = sprintf($this->html['brief'], $item['link'], $item['title'], $item['date'], $item['description']);
}
$title = '';
if (empty($options['showtitle'])) {
$title = sprintf("<div class='feed-title'><h2>%s</h2><hr>%s</div>\n", $data['title'], $data['description']);
}
$out = "<div class='feed-container'>\n" . $title . join(" \n", $out) . "</div>";
return $out;
}
/**
* Render blog widget with title, date & content
*
* @param $data
* @param $options
* @return
*/
function widgetDetail($data, $options = array()) {
if (empty($data['items'])) {
return false;
}
$out = array();
foreach ($data['items'] as $item) {
if (empty($item['date'])) {
$item['date'] = '';
}
if (empty($item['content'])) {
$item['content'] = $item['description'];
}
$out[] = sprintf($this->html['detail'], $item['link'], $item['title'], $item['date'], $item['content']);
}
$title = '';
if (empty($options['showtitle'])) {
$title = sprintf("<div class='feed-title'><h2>%s</h2><hr>%s</div>\n", $data['title'], $data['description']);
}
$out = "<div class='feed-container'>\n" . $title . join(" \n", $out) . "</div>";
return $out;
}
}
?>
Usage Example: some quick examples are given below to introduce you with the class and it’s methods.
File: example.php
<?php
/**
* Example Usage or RayFeedReader
*/
require_once('rayfeedreader.php');
/**
* get Instance
*/
$reader1 = RayFeedReader::getInstance();
$reader2 = RayFeedReader::getInstance($options);
$reader3 = new RayFeedReader();
$reader4 = new RayFeedReader($options);
/**
* get data from a feed url
*/
$options = array('url' => 'http://example.com/feed');
$feedData = RayFeedReader::getInstance($options)->parse()->getData();
// Or options can be set anytime using setOptions method.
$feedData = RayFeedReader::getInstance()->setOptions($options)->parse()->getData();
/**
* Get html widget
*/
$options = array(
'url' => 'http://example.com/feed',
'widget' => 'RayFeedWidget',
);
/**
* Load rayFeedWidget class file
*/
require_once('rayfeedwidget.php');
$html = RayFeedReader::getInstance()->setOptions($options)->parse()->widget();
// OR with widget options.
$widgetOptions = array('widget' => 'detail', 'showTitle' => true);
$html = RayFeedReader::getInstance()->setOptions($options)->parse()->widget($widgetOptions);
/**
* Full options
*/
$options = array(
'url' => 'http://example.com/feed',
'widget' => 'RayFeedWidget',
'httpClient' => 'rayHttp',
'type' => 'atom',
);
/**
* Load rayHttp class file.
*/
require_once("rayhttp.php");
/**
* Html widget with full options
*/
$html = RayFeedReader::getInstance()->setOptions($options)->parse()->widget();
/**
* Get Feed Data with full options
*/
$feedData = RayFeedReader::getInstance($options)->parse()->getData();
?>
Please let me know if you find this class helpful for you..
]]>Class Update:
An updated version of this class and example script are posted at PHPClasses.org, http://www.phpclasses.org/browse/package/5652.html. Please use class from PHPClasses.org for bug fixed latest version.
I-Blood offers donor profile for every member. Which is still in improvement.
Profile badge image for i-blood beta version is available now. Here is the image:
Here is the link to the image: http://beta.i-blood.com/img/i-blood-badge.gif
Here is the sample code widget for placing the badge on your blog:
<p>
<a href="http://beta.i-blood.com/g/profiles/pub/45">
<img src="http://beta.i-blood.com/img/i-blood-badge.gif" border="0" alt="View Md. Rayhan Chowdhury's donor profile on I-Blood" width="160" height="38" />
</a>
</p>
just make a little change to the code above, change my profile link with your profile link and also my name with your name.
]]>Updating your social networking status is now a frequent job. To make this job easier there are lots of web services, desktop applications, mobile applications, plug-ins available to the users. Some people wants to update there status from a single place. Like others Ping.fm, Hellotxt.com are providing single place service with a variety of options. But I think that updating status from command line is the easiest way for most of the Linux users who loves their terminal.
I have used ping.fm REST API for my script as a result It can update all the services registered with ping.fm at once or a single service putting additional parameter. You just need the Internet connection and terminal to put the command.
File: ~/bin/raypm
#! /usr/bin/env python
"""
A Simple program to update your social networking status using ping.fm
This program will update all your social networking sites via ping.fm.
requirements
- sign for a account at ping.fm
- setup ping.fm for desired social networking sites.
- get your developer api key http://www.ping.fm/developers
- get your user key from http://www.ping.fm/key
@example
- shell > raypm "your message text to update your all social networking status, like twitter, facebook, linkedin"
- shell > raypm twitter "your message text to update twitter status only"
- shell > raypm facebook "your message text to update facebook status only"
@author : Md. Rayhan Chowdhury
@email : ray@raynux.com
@website : www.raynux.com
@license : GPL
@copy : All right are reserved
"""
import urllib
import urllib2
import sys
from xml.etree import ElementTree as ET
# modify __apiKey__ with your own
# get your apiKey from http://www.ping.fm/developers
__apiKey__ = 'YOUR DEVELOPER API KEY HERE'
# modify __userKey__ with your own user key
# get your user key from http://www.ping.fm/key
__UserKey__ = "YOUR USER APP KEY HERE"
__apiUrl__ = 'http://api.ping.fm/v1/'
# debug
# 1 - will not update your status, dump xml response text
# 0 - will update your status
debug = 0
class RayStatus:
def __init__(self, msg = None, service = None):
"create message"
global debug
data = { 'api_key' : __apiKey__,
'user_app_key' : __UserKey__,
'post_method' : 'default',
'body' : msg,
'debug' : debug
}
if service is not None:
data['service'] = service
#Encode the data to be posted
data = urllib.urlencode(data)
print "Loading..."
# post the data
req = urllib2.Request(__apiUrl__ + 'user.post', data)
try:
response = urllib2.urlopen(req)
responseXML = response.read()
# parse response data
result = ET.XML(responseXML)
if result.attrib is not None:
if result.attrib['status'] == 'OK':
print 'Congratulations! your message posted successfully!';
else:
print 'Error: ' + result[2].text
if debug:
print
print "debug info: "
print responseXML
except urllib2.URLError, e:
if hasattr(e, 'reason'):
print 'Could not connect to the server.'
print 'Reason: ', e.reason
elif hasattr(e, 'code'):
print 'The server couldn\'t fulfill the request.'
print 'Error code: ', e.code
else:
print
if __name__ == '__main__':
try:
if (len(sys.argv) == 2):
RayStatus(sys.argv[1], None)
elif (len(sys.argv) == 3):
RayStatus(sys.argv[2], sys.argv[1])
except IndexError:
print "Please enter your desired message to be posted."
To make the script working, you need to sign up for a ping.fm user account, and registrar for services you want, they support all major social networking sites including twitter, facebook, linkedIn.
You will need to get these two keys.
- developer api_keys from http://ping.fm/developers/
- user app key from http://ping.fm/key/
I have my developer api key from ping.fm which will work for you, but I can’t disclose it openly. It will be great to have your own api key and user key is unique for each user.
Installation:
# chmod +x ~/bin/raypm
& done.
now you can update your status with the following commands
# raypm "update all social networking status at once"
or
# raypm twitter "update twitter status only"
or
# raypm facebook "update facebook status only"
and
Looks like after setting everything up, I will finally be able to sell hemp oil! I will start big by selling it on hemp oil amazon. Let’s see how things develop for a little while. It took a lot of work to get here.
Today I set up my domain raynux.com with gmail. From now on I will use ray@raynux.com as my email address along with rayhanwm@gmail.com.
Thanks to Allah.
]]>