Baseball Widgets

Baseball Widgets

Baseball enjoys popularity mainly among North American and East Asian population. This bat-and-ball game developed from older games available in England in mid-18th century. In the US, baseball became a national sport soon after importing the game. With a great fan base avid on results and statistics, webmasters can deliver fresh data using below baseball widgets.

WidgetLab.net lists below a range of widget codes that can be implemented into any website to deliver free and updated baseball info ⚾, results and stats.

Recommendation: do not include more than one widget in a page or you risk to slow your website.

ONE IMPLEMENTATION

You implement the widget code one time and we take care of the rest. The content gets updated automatically, no other coding and changes afterwards.

FREE FOREVER

The content provided is free to implement. Getting this from other sources will require to pay for access to their services along with any development work.

SEO BEST

It can also improve your SEO work as content will be seen as originating on your website. Search engines will index the content and rank your pages for it.

League Table Rankings

To show latest Baseball league table rankings, you can copy and paste below widget code in your webpage, where you wish the table to appear (select your implementation platform):

.PHP Files.HTML / .HTM FilesWordpressJoomla

1. Copy below widget code in a Notepad file

<div><?php
$html = "";
$url = "http://widget.widgetlab.net/baseball/data/rank-mlb-american.xml";
$xml = simplexml_load_file($url);
$description = $xml->channel->item->description;
$html .= "$description"; 
echo $html;
?></div>

2. Edit the parameter in the URL source on line 3 of the code, after /data/, with one of the parameters you want, listed in Parameters table below

3. Paste the edited code in your .PHP webpage of your website, where you wish the widget to appear.

4. Visit your website and see how the widget shows the latest league rankings

1. Copy below widget code in a Notepad file

<div><?php
$html = "";
$url = "http://widget.widgetlab.net/baseball/data/rank-mlb-american.xml";
$xml = simplexml_load_file($url);
$description = $xml->channel->item->description;
$html .= "$description"; 
echo $html;
?></div>

2. Edit the parameter in the URL source on line 3 of the code, after /data/, with one of the parameters you want, listed in Parameters table below

3. Paste the edited code in your .HTML / .HTM webpage of your website, where you wish the widget to appear.

4. As HTML/HTML files do not natively run PHP code, you need to add the following code line in the .htaccess file from the route of your website

AddType application/x-httpd-php .html .htm

If there is no file, you can create one. The .htaccess code may be different from a web hosting to another, so in case above code does not work, please view your hosting FAQ or contact their support and ask for correct .htaccess settings to run PHP code in HTML/HTM files

5. Visit your website and see how the widget shows the latest league rankings

1. If you are using WordPress as the platform of your website, you need to install a plugin like Insert PHP that can run the php code in your WordPress posts/pages

2. After installing above WP plugin, copy the code below in a Notepad file

<div>[insert_php]
$html = "";
$url = "http://widget.widgetlab.net/baseball/data/rank-mlb-american.xml";
$xml = simplexml_load_file($url);
$description = $xml->channel->item->description;
$html .= "$description"; 
echo $html;
[/insert_php]</div>

3. Edit the parameter in the URL source on line 3 of the code, after /data/, with one of the parameters you want, listed in Parameters table below

4. Paste the edited shortcode in your WP post, where you wish the data to appear (ATTENTION: select Text view when including the code in your post and save it like that – do not change back to Visual as it will break your code).

5. Visit your website and see how the widget shows the latest league rankings

1. If you are using Joomla as the platform of your website, you need to install an extension like Sourcerer that can run the php code in your Joomla articles

2. After installing above Joomla plugin, copy the code below in a Notepad file

{source}<div><?php
$html = "";
$url = "http://widget.widgetlab.net/baseball/data/rank-mlb-american.xml";
$xml = simplexml_load_file($url);
$description = $xml->channel->item->description;
$html .= "$description"; 
echo $html;
?></div>{/source}

3. Edit the parameter in the URL source on line 3 of the code, after /data/, with one of the parameters you want, listed in Parameters table below

4. Paste the edited shortcode in your Joomla article, where you wish the data to appear.

5. Visit your website and see how the widget shows the latest league rankings

Parameters: Baseball Table Rankings

  • MLB American League – rank-mlb-american.xml
  • MLB National League – rank-mlb-national.xml

 

Latest Match Results

To show latest match results by baseball competition, you can copy and paste below widget code in your webpage, where you wish the results to appear:

COMING SOON

Data widgets available in this page are provided by WidgetLab.net