RSS

Category Archives: javascript

Amazon S3 Cloud HTML5 MP3 Player

Amazon S3 Cloud HTML5 Player plugin that allows you to link to your amazon S3 bucket and sets up a HTML5 Player playlist (horizontal or vertical). This plugin will support MP3 files only.

Amazon S3 Cloud HTML5 MP3 Player is not associated in any way to amazon.com

Get Self Hosted Amazon S3 Cloud HTML5 MP3 Player for WordPress just in $15

You will need an amazon account to use this.

AWS access info

Add your amazon information amazon key and amazon secret key. Then just add the bucket to your account add folders.

Amazon S3 Cloud HTML5 MP3 Player Options

Amazon S3 Cloud HTML5 MP3 Player Options

Make sure you have public permission for all your music in your S3 buckets and folders.

S3 Management Console

S3 Management Console

Shortcode for Page or Post

[html5aws3mp3 player=”horizontal” bucket=”BUCKET” endpoint=”BUCKET-ENDPINT” folder=”FOLDER/”]

Plugin Page

Amazon S3 Error Handling

AWS CloudFront with PHP

Create sub buckets on amazon s3

Amazon S3 Cloud HTML5 MP3 Player is not associated in any way to amazon.com

Advertisements
 

Tags: , , ,

Be aware while use online banking

 

Google Map – Info Window

Demo | Download

Contact me “svnlabs@gmail.com” for google map customization 🙂

Never feel sad on losing anything in ur life, Because whenever a Tree loses its leaf, A new leaf is ready to take it’s place…

 
2 Comments

Posted by on January 31, 2011 in Imagine, javascript, Open Source, php, Tips, Tricks

 

Tags: , , , , , , , , , ,

Custom Google Search – setQueryAddition

Google Custom Search service provide customized search for web on your site or blog.
We can filter Google Custom Search results on filetype like PDF 🙂

http://www.svnlabs.com/demo/cse.php

You have to initiate below JavaScript on event…

// create a tabbed mode search control
var tabbed = new GSearchControl();

tabbed.setResultSetSize(GSearch.LARGE_RESULTSET);

// add an additional term to the query
// in this case filetype:pdf
var searcher = new GwebSearch();

//searcher.setResultSetSize(GSearch.LARGE_RESULTSET);

searcher.setUserDefinedLabel("svnlabs (pdf)");
searcher.setQueryAddition("filetype:pdf");

//searcher.setResultSetSize(GSearch.LARGE_RESULTSET);

var searcherOptions = new GsearcherOptions();
searcherOptions.setExpandMode(GSearchControl.EXPAND_MODE_OPEN);

tabbed.addSearcher(searcher, searcherOptions);

// draw in tabbed layout mode
var drawOptions = new GdrawOptions();
drawOptions.setDrawMode(GSearchControl.DRAW_MODE_TABBED);
tabbed.draw(document.getElementById("search_control_tabbed"), drawOptions);

// PHP keyword in search box
tabbed.execute("PHP");

Every day do one thing that you think you cannot do. Soon you will realize that there is nothing that you can not do…

http://rcm.amazon.com/e/cm?t=svnlabs09-20&o=1&p=12&l=ur1&category=apparel&f=ifr

 
Leave a comment

Posted by on January 31, 2011 in Imagine, javascript, Open Source, php, Tips, Tricks

 

Tags: , , , , , , , , , , , , , ,

json_add for php

JSON (JavaScript Object Notation) is a lightweight data-interchange format.

1. Easy for humans to read and write.
2. Easy for machines to parse and generate.
3. Collection of name/value pairs.
4. Used for C, C++, C#, Java, JavaScript, Perl, Python, and many others.
5. Compatible with universal data structures – array, vector, list, or sequence.

json_decode — Decodes a JSON string
json_encode — Returns the JSON representation of a value
json_add — Review below code 😉

<?php
function json_add($old, $new) {  // function to add json strings  $old, $new are arrays
        $old_arr = json_decode($old, true);
        if(is_array($old_arr)) {
            $new_arr = array_merge($old_arr, $new);
            return json_encode($new_arr);
        }
        else {
            // it means first column updation
            return json_encode ( $new );
        }
    }

/*
here $json_str is json formated string in which we have to add new $array
*/
json_add($json_str, $array);    
    
?>

Every opportunity is trouble… Every trouble is opportunity 😉

 

Tags: , , , , , ,

Custom Google Search

Google Custom Search service provide customized search for web on your site or blog.

1. We can add site’s links to get fast and relevant search results
2. We can make money with AdSense for Search
3. We can invite friends and community to contribute
4. We can include one or more websites, or specific webpages
5. We can host the search box and results on your own website
6. We can customize the look and feel of the results to match your site

http://www.google.com/cse/

We can make topic / site specific search on google see below

Magento Search Engine

We can integrate custom google search with our site search, we have to add below to our site…

<script type=”text/javascript”>

window.onload = function()
{

jQuery(“.gsc-input”).focus();  // google search input box

jQuery(“.gsc-input”).val(‘<?php echo isset($_REQUEST[‘q’])?$_REQUEST[‘q’]:”; ?>’); // auto fill site’s search keyword to custome search

jQuery(“.gsc-search-button”).click(); // trigger submit event

}

</script>

Waves are my inspiration, not because they rise and fall, but each time they fall They Rise Again… 🙂

 
 

Tags: , , , , , ,

Web scraping using firefox & jQuery

Hello Friends,

Today we will scrape HTML from any web page using jQuery and firefox firebug console. This is useful when you want to grab HTML of web page dynamically created by JavaScript or Ajax.

This example is quite useful when you want to extract any web content based on HTML Tag element ID or Class like ‘<div id=”svnlabs”></div>’ or ‘<img src=”svnlabs.jpg” id=”svn_labs”>’

See the code in action here… scraper.txt

jQuery(“body”).append(‘<textarea id=”svnlabs” cols=”70″ rows=”20″></textarea>’);

jQuery(“#svnlabs”).val(jQuery(“body”).html());

OR

copy and paste below code in browser address bar….

javascript: jQuery(“body”).append(‘<textarea id=”svnlabs” cols=”70″ rows=”20″></textarea>’); jQuery(“#svnlabs”).val(jQuery(“body”).html());

You have to post above code in firefox firebug javascript console. The latest jQuery library must be included on that web page you want to scrap 😉
Above two JavaScript lines will add a new textarea in body of same web page to set content of any HTML element. Please make sure after copy the above code; no illegal character in it.

Keep blogging……… 😉

 
13 Comments

Posted by on November 18, 2010 in javascript, Launch, Open Source, Tips, Tricks

 

Tags: , , , , , , ,