SlideShare a Scribd company logo
1 of 13
Download to read offline
Creating SlideShare Instant   Demo :   http://home.iitb.ac.in/~saket.kumar/slideshare Source:https://github.com/saketkc/SlideShare-Instant t Saket Choudhary http://home.iitb.ac.in/~saket.kumar IIT Bombay
What is “Instant”? 1.Get spontaneous results “on the go” while you type. 2.Saves time 3.First results are generally preffered reults hence search the “browsing  Example: 1. Google Search Instant(Results appear as you type) 2. YouTube Instant : The thing that actually landd up its creator with a job offer !
SlideShare Instant !   Get instant results for your Slide/Document Search !   Not Satisfied with the first result?? Go Click the “Next” button ! Not So Fast Yet ! Well the source code is all open Go edit it ! Just Respect the Open Source Terms: https://github.com/saketkc/SlideShare-Instant Demo available at:  http://home.iitb.ac.in/~saket.kumar/slideshare
Requirements 1.AJAX calls (Hail Google !) 2.PHP  ( My favourite on Web So far ! I am falling in love with  RoR  though) 3. Javascript(jquery) 4. CSS (Brains with Beauty is the way everyonr likes it ! )
Code Snippets <input type=&quot;text&quot; class='search_input'  /><br/> Define an “onkeyup” event sen an ajax GET request to 'ajax.php' containing the parameters:  the 'ajaxeeequest' and 'query' $(&quot;.search_input&quot;).keyup(function()  { var search_input = $(this).val(); var keyword= encodeURIComponent(search_input); $.ajax({   type: &quot;GET&quot;,   url: &quot;ajax.php&quot;,    data:{'op':'ajaxrequest','query':keyword},   success: function(msg){    $('.inner').html(msg); //fetch the Slide and echo it on the page   }  }); });
Contact Me I am a Sophomore at IIT Bombay as of 2011 . I can be contacted at  [email_address]
Ajax.php <?php session_start(); $var=array(); global $vaar; //$var=[]; if ($_GET['op']==&quot;ajaxrequest&quot;) {$var=$_GET['query']; $api_key=&quot;8GD14Jk1&quot;; $secret=&quot;mnFaUN4s&quot;; $proxy=&quot;proxy&quot;; $pass=&quot;user:pwd&quot;; $timeout=0; $ts=time(); $hash=sha1($secret.$ts); # use CURL library to fetch remote file $apiurl=&quot;http://www.slideshare.net/api/2/search_slideshows?q=$var&quot;; $ch = curl_init(); curl_setopt ($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_PROXY, $proxy); curl_setopt($ch, CURLOPT_PROXYPORT,80); curl_setopt($ch, CURLOPT_PROXYUSERPWD,$pass); $url = $apiurl.&quot;&api_key=$api_key&ts=$ts&hash=$hash&items_per_page=1&quot;; curl_setopt ($ch, CURLOPT_URL, $url); $file_contents = curl_exec($ch); $xml = simplexml_load_string($file_contents); $number=1; foreach ( $xml->Slideshow as $files) {  $_SESSION[$var][$number]=$files->Embed;    //echo $_SESSION['sad']['2'];  $vaar[$number]=$_SESSION[$var][$number];  echo ($vaar[$number]);  $number=$number+1; } }
if ($_GET['op']==&quot;numberrequest&quot;) { // session_start(); $num=$_GET['number']; $query=$_GET['query']; $api_key=&quot;8GD14Jk1&quot;; $secret=&quot;mnFaUN4s&quot;; $proxy=”proxy” $pass=&quot;user:pwd”; $timeout=0; $ts=time(); $hash=sha1($secret.$ts); # use CURL library to fetch remote file $apiurl=&quot;http://www.slideshare.net/api/2/search_slideshows?q=$query&quot;;
$ch = curl_init(); curl_setopt ($ch, CURLOPT_RETURNTRANSFER,1); curl_setopt($ch, CURLOPT_PROXY, $proxy); curl_setopt($ch, CURLOPT_PROXYPORT,80); curl_setopt($ch, CURLOPT_PROXYUSERPWD,$pass); $url = $apiurl.&quot;&api_key=$api_key&ts=$ts&hash=$hash&items_per_page=$num&quot;; curl_setopt ($ch, CURLOPT_URL, $url); $file_contents = curl_exec($ch); //$res =  simplexml_load_file($file_contents); $xml = simplexml_load_string($file_contents); $number=1; foreach ( $xml->Slideshow as $files) {  $_SESSION[$var][$number]=$files->Embed;    $vaar[$number]=$_SESSION[$var][$number];  if ($number==$num)  {  echo $files->Embed;  }    $number=$number+1; }}   ?>
Index.php <!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;> <html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;> <head> <meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=iso-8859-1&quot; />  <LINK href=&quot;style.css&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot;> <title>SlideShare Instant</title> <script type=&quot;text/javascript&quot; src=&quot;http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js&quot;></script> <script src=&quot;http://chrisslidesharehacks.googlecode.com/files/previewer2.js&quot;></script> <script type=&quot;text/javascript&quot;> $(document).ready(function() { var number=01; $(&quot;.search_input&quot;).focus(); $(&quot;.search_input&quot;).keyup(function()  { var search_input = $(this).val(); var keyword= encodeURIComponent(search_input); $.ajax({   type: &quot;GET&quot;,   url: &quot;ajax.php&quot;,   data:{'op':'ajaxrequest','query':keyword},   success: function(msg){   $('.inner').html(msg);   }  }); });
$('#next').click(function() {   number=number+1;   var keyword = $(&quot;.search_input&quot;).val();   $.ajax({   type: &quot;GET&quot;,   url: &quot;ajax.php&quot;,   data:{'op':'numberrequest','query':keyword,'number':number},   success: function(msg){   $('.inner').html(msg);//=msg;   }  }); }); $('#prev').click(function() {     number=number-1;   var keyword = $(&quot;.search_input&quot;).val();
$.ajax({   type: &quot;GET&quot;,   url: &quot;ajax.php&quot;,   data:{'op':'numberrequest','query':keyword,'number':number},   success: function(msg){   $('.inner').html(msg);//=msg;   }  }); }); }); </script> <body> <center> SlideShare Instant Query<input type=&quot;text&quot; class='search_input'  /><br/> <div class=&quot;container&quot;> <div class=&quot;inner&quot;></div> <button id=&quot;next&quot;> Next--</div> <button id=&quot;prev&quot;>--Prev</div> </div> </center> </body>

More Related Content

What's hot

Learn chinese name from getting a chinese name
Learn chinese name from getting a chinese nameLearn chinese name from getting a chinese name
Learn chinese name from getting a chinese namemiles peng
 
Facebook Development with Zend Framework
Facebook Development with Zend FrameworkFacebook Development with Zend Framework
Facebook Development with Zend FrameworkBrett Harris
 
Html5的应用与推行
Html5的应用与推行Html5的应用与推行
Html5的应用与推行Sofish Lin
 
Multimedia on the web - HTML5 video and audio
Multimedia on the web - HTML5 video and audioMultimedia on the web - HTML5 video and audio
Multimedia on the web - HTML5 video and audioChristian Heilmann
 
Mojolicious - A new hope
Mojolicious - A new hopeMojolicious - A new hope
Mojolicious - A new hopeMarcus Ramberg
 
Behat - Drupal South 2018
Behat  - Drupal South 2018Behat  - Drupal South 2018
Behat - Drupal South 2018Berend de Boer
 
計算機概論20161205
計算機概論20161205計算機概論20161205
計算機概論20161205志宇 許
 
Desafios do Profissionalismo Ágil
Desafios do Profissionalismo ÁgilDesafios do Profissionalismo Ágil
Desafios do Profissionalismo ÁgilVictor Hugo Germano
 
計算機概論20161212
計算機概論20161212計算機概論20161212
計算機概論20161212志宇 許
 
Reno-Tahoe WordCamp 2011 - WordPress End User Security - Dre Armeda
Reno-Tahoe WordCamp 2011 - WordPress End User Security - Dre ArmedaReno-Tahoe WordCamp 2011 - WordPress End User Security - Dre Armeda
Reno-Tahoe WordCamp 2011 - WordPress End User Security - Dre ArmedaDre Armeda
 
Advanced and Hidden WordPress APIs
Advanced and Hidden WordPress APIsAdvanced and Hidden WordPress APIs
Advanced and Hidden WordPress APIsandrewnacin
 
Page Caching Resurrected
Page Caching ResurrectedPage Caching Resurrected
Page Caching ResurrectedBen Scofield
 
Evolution of API With Blogging
Evolution of API With BloggingEvolution of API With Blogging
Evolution of API With BloggingTakatsugu Shigeta
 
Web Projects: From Theory To Practice
Web Projects: From Theory To PracticeWeb Projects: From Theory To Practice
Web Projects: From Theory To PracticeSergey Bolshchikov
 
Php Basic Security
Php Basic SecurityPhp Basic Security
Php Basic Securitymussawir20
 
#3 HTML & CSS [know-how]
#3 HTML & CSS [know-how]#3 HTML & CSS [know-how]
#3 HTML & CSS [know-how]Dalibor Gogic
 
HTML5 and the web of tomorrow!
HTML5  and the  web of tomorrow!HTML5  and the  web of tomorrow!
HTML5 and the web of tomorrow!Christian Heilmann
 

What's hot (20)

Learn chinese name from getting a chinese name
Learn chinese name from getting a chinese nameLearn chinese name from getting a chinese name
Learn chinese name from getting a chinese name
 
BDD with cucumber
BDD with cucumberBDD with cucumber
BDD with cucumber
 
Facebook Development with Zend Framework
Facebook Development with Zend FrameworkFacebook Development with Zend Framework
Facebook Development with Zend Framework
 
Using HTML5 sensibly
Using HTML5 sensiblyUsing HTML5 sensibly
Using HTML5 sensibly
 
Html5的应用与推行
Html5的应用与推行Html5的应用与推行
Html5的应用与推行
 
Multimedia on the web - HTML5 video and audio
Multimedia on the web - HTML5 video and audioMultimedia on the web - HTML5 video and audio
Multimedia on the web - HTML5 video and audio
 
Mojolicious - A new hope
Mojolicious - A new hopeMojolicious - A new hope
Mojolicious - A new hope
 
Mojolicious on Steroids
Mojolicious on SteroidsMojolicious on Steroids
Mojolicious on Steroids
 
Behat - Drupal South 2018
Behat  - Drupal South 2018Behat  - Drupal South 2018
Behat - Drupal South 2018
 
計算機概論20161205
計算機概論20161205計算機概論20161205
計算機概論20161205
 
Desafios do Profissionalismo Ágil
Desafios do Profissionalismo ÁgilDesafios do Profissionalismo Ágil
Desafios do Profissionalismo Ágil
 
計算機概論20161212
計算機概論20161212計算機概論20161212
計算機概論20161212
 
Reno-Tahoe WordCamp 2011 - WordPress End User Security - Dre Armeda
Reno-Tahoe WordCamp 2011 - WordPress End User Security - Dre ArmedaReno-Tahoe WordCamp 2011 - WordPress End User Security - Dre Armeda
Reno-Tahoe WordCamp 2011 - WordPress End User Security - Dre Armeda
 
Advanced and Hidden WordPress APIs
Advanced and Hidden WordPress APIsAdvanced and Hidden WordPress APIs
Advanced and Hidden WordPress APIs
 
Page Caching Resurrected
Page Caching ResurrectedPage Caching Resurrected
Page Caching Resurrected
 
Evolution of API With Blogging
Evolution of API With BloggingEvolution of API With Blogging
Evolution of API With Blogging
 
Web Projects: From Theory To Practice
Web Projects: From Theory To PracticeWeb Projects: From Theory To Practice
Web Projects: From Theory To Practice
 
Php Basic Security
Php Basic SecurityPhp Basic Security
Php Basic Security
 
#3 HTML & CSS [know-how]
#3 HTML & CSS [know-how]#3 HTML & CSS [know-how]
#3 HTML & CSS [know-how]
 
HTML5 and the web of tomorrow!
HTML5  and the  web of tomorrow!HTML5  and the  web of tomorrow!
HTML5 and the web of tomorrow!
 

Viewers also liked (17)

ch1
ch1ch1
ch1
 
Equips de 4 t
Equips de 4 tEquips de 4 t
Equips de 4 t
 
ch1
ch1ch1
ch1
 
ch1
ch1ch1
ch1
 
Equips de 4 t
Equips de 4 tEquips de 4 t
Equips de 4 t
 
Headhunting
HeadhuntingHeadhunting
Headhunting
 
Equips de 4 t
Equips de 4 tEquips de 4 t
Equips de 4 t
 
Campionat 4t
Campionat 4tCampionat 4t
Campionat 4t
 
ch1
ch1ch1
ch1
 
Python Workshop
Python WorkshopPython Workshop
Python Workshop
 
ch1
ch1ch1
ch1
 
Internship @SlideShare -My Experiences
Internship @SlideShare -My ExperiencesInternship @SlideShare -My Experiences
Internship @SlideShare -My Experiences
 
Global_Health_and_Intersectoral_Collaboration
Global_Health_and_Intersectoral_CollaborationGlobal_Health_and_Intersectoral_Collaboration
Global_Health_and_Intersectoral_Collaboration
 
Pattern Recognition in Clinical Data
Pattern Recognition in Clinical DataPattern Recognition in Clinical Data
Pattern Recognition in Clinical Data
 
CL 324 PRoj
CL 324 PRojCL 324 PRoj
CL 324 PRoj
 
SlideShare Instant
SlideShare InstantSlideShare Instant
SlideShare Instant
 
Sniffer[1]
Sniffer[1]Sniffer[1]
Sniffer[1]
 

Similar to SlideShare Instant

PHP Presentation
PHP PresentationPHP Presentation
PHP PresentationAnkush Jain
 
Introduction To Lamp
Introduction To LampIntroduction To Lamp
Introduction To LampAmzad Hossain
 
The Basics Of Page Creation
The Basics Of Page CreationThe Basics Of Page Creation
The Basics Of Page CreationWildan Maulana
 
Phing - A PHP Build Tool (An Introduction)
Phing - A PHP Build Tool (An Introduction)Phing - A PHP Build Tool (An Introduction)
Phing - A PHP Build Tool (An Introduction)Michiel Rook
 
Система рендеринга в Magento
Система рендеринга в MagentoСистема рендеринга в Magento
Система рендеринга в MagentoMagecom Ukraine
 
WordPress Development Confoo 2010
WordPress Development Confoo 2010WordPress Development Confoo 2010
WordPress Development Confoo 2010Brendan Sera-Shriar
 
Getting the Most Out of OpenSocial Gadgets
Getting the Most Out of OpenSocial GadgetsGetting the Most Out of OpenSocial Gadgets
Getting the Most Out of OpenSocial GadgetsAtlassian
 
Migration testing framework
Migration testing frameworkMigration testing framework
Migration testing frameworkIndicThreads
 
Web Scraper Shibuya.pm tech talk #8
Web Scraper Shibuya.pm tech talk #8Web Scraper Shibuya.pm tech talk #8
Web Scraper Shibuya.pm tech talk #8Tatsuhiko Miyagawa
 
Mechanize at the Ruby Drink-up of Sophia, November 2011
Mechanize at the Ruby Drink-up of Sophia, November 2011Mechanize at the Ruby Drink-up of Sophia, November 2011
Mechanize at the Ruby Drink-up of Sophia, November 2011rivierarb
 
Enterprise Google Gadgets Integrated with Alfresco - Open Source ECM
Enterprise Google Gadgets Integrated with Alfresco - Open Source ECM Enterprise Google Gadgets Integrated with Alfresco - Open Source ECM
Enterprise Google Gadgets Integrated with Alfresco - Open Source ECM Alfresco Software
 
Developing and testing ajax components
Developing and testing ajax componentsDeveloping and testing ajax components
Developing and testing ajax componentsIgnacio Coloma
 
Client-side JavaScript Vulnerabilities
Client-side JavaScript VulnerabilitiesClient-side JavaScript Vulnerabilities
Client-side JavaScript VulnerabilitiesOry Segal
 
Flash Templates- Joomla!Days NL 2009 #jd09nl
Flash Templates- Joomla!Days NL 2009 #jd09nlFlash Templates- Joomla!Days NL 2009 #jd09nl
Flash Templates- Joomla!Days NL 2009 #jd09nlJoomla!Days Netherlands
 
Flash templates for Joomla!
Flash templates for Joomla!Flash templates for Joomla!
Flash templates for Joomla!Herman Peeren
 
PHP Presentation
PHP PresentationPHP Presentation
PHP PresentationNikhil Jain
 
Forum Presentation
Forum PresentationForum Presentation
Forum PresentationAngus Pratt
 

Similar to SlideShare Instant (20)

PHP Presentation
PHP PresentationPHP Presentation
PHP Presentation
 
Introduction To Lamp
Introduction To LampIntroduction To Lamp
Introduction To Lamp
 
Php 3 1
Php 3 1Php 3 1
Php 3 1
 
The Basics Of Page Creation
The Basics Of Page CreationThe Basics Of Page Creation
The Basics Of Page Creation
 
Phing - A PHP Build Tool (An Introduction)
Phing - A PHP Build Tool (An Introduction)Phing - A PHP Build Tool (An Introduction)
Phing - A PHP Build Tool (An Introduction)
 
Система рендеринга в Magento
Система рендеринга в MagentoСистема рендеринга в Magento
Система рендеринга в Magento
 
Web Scraping with PHP
Web Scraping with PHPWeb Scraping with PHP
Web Scraping with PHP
 
WordPress Development Confoo 2010
WordPress Development Confoo 2010WordPress Development Confoo 2010
WordPress Development Confoo 2010
 
Getting the Most Out of OpenSocial Gadgets
Getting the Most Out of OpenSocial GadgetsGetting the Most Out of OpenSocial Gadgets
Getting the Most Out of OpenSocial Gadgets
 
Migration testing framework
Migration testing frameworkMigration testing framework
Migration testing framework
 
Web Scraper Shibuya.pm tech talk #8
Web Scraper Shibuya.pm tech talk #8Web Scraper Shibuya.pm tech talk #8
Web Scraper Shibuya.pm tech talk #8
 
Mechanize at the Ruby Drink-up of Sophia, November 2011
Mechanize at the Ruby Drink-up of Sophia, November 2011Mechanize at the Ruby Drink-up of Sophia, November 2011
Mechanize at the Ruby Drink-up of Sophia, November 2011
 
Enterprise Google Gadgets Integrated with Alfresco - Open Source ECM
Enterprise Google Gadgets Integrated with Alfresco - Open Source ECM Enterprise Google Gadgets Integrated with Alfresco - Open Source ECM
Enterprise Google Gadgets Integrated with Alfresco - Open Source ECM
 
Developing and testing ajax components
Developing and testing ajax componentsDeveloping and testing ajax components
Developing and testing ajax components
 
Client-side JavaScript Vulnerabilities
Client-side JavaScript VulnerabilitiesClient-side JavaScript Vulnerabilities
Client-side JavaScript Vulnerabilities
 
Flash Templates- Joomla!Days NL 2009 #jd09nl
Flash Templates- Joomla!Days NL 2009 #jd09nlFlash Templates- Joomla!Days NL 2009 #jd09nl
Flash Templates- Joomla!Days NL 2009 #jd09nl
 
Flash templates for Joomla!
Flash templates for Joomla!Flash templates for Joomla!
Flash templates for Joomla!
 
DevDays09 Internet Explorer 8
DevDays09 Internet Explorer 8DevDays09 Internet Explorer 8
DevDays09 Internet Explorer 8
 
PHP Presentation
PHP PresentationPHP Presentation
PHP Presentation
 
Forum Presentation
Forum PresentationForum Presentation
Forum Presentation
 

More from Saket Choudhary (20)

ISG-Presentacion
ISG-PresentacionISG-Presentacion
ISG-Presentacion
 
ISG-Presentacion
ISG-PresentacionISG-Presentacion
ISG-Presentacion
 
gsoc2012demo
gsoc2012demogsoc2012demo
gsoc2012demo
 
testppt
testppttestppt
testppt
 
testppt
testppttestppt
testppt
 
testppt
testppttestppt
testppt
 
testppt
testppttestppt
testppt
 
testppt
testppttestppt
testppt
 
Training_Authoring
Training_AuthoringTraining_Authoring
Training_Authoring
 
Training_Authoring
Training_AuthoringTraining_Authoring
Training_Authoring
 
Training_Authoring
Training_AuthoringTraining_Authoring
Training_Authoring
 
Training_Authoring
Training_AuthoringTraining_Authoring
Training_Authoring
 
Training_Authoring
Training_AuthoringTraining_Authoring
Training_Authoring
 
Training_Authoring
Training_AuthoringTraining_Authoring
Training_Authoring
 
Training_Authoring
Training_AuthoringTraining_Authoring
Training_Authoring
 
Training_Authoring
Training_AuthoringTraining_Authoring
Training_Authoring
 
Testslideshare1
Testslideshare1Testslideshare1
Testslideshare1
 
Testslideshare1
Testslideshare1Testslideshare1
Testslideshare1
 
Testslideshare1
Testslideshare1Testslideshare1
Testslideshare1
 
Testslideshare1
Testslideshare1Testslideshare1
Testslideshare1
 

Recently uploaded

Meet the new FSP 3000 M-Flex800™
Meet the new FSP 3000 M-Flex800™Meet the new FSP 3000 M-Flex800™
Meet the new FSP 3000 M-Flex800™Adtran
 
Crea il tuo assistente AI con lo Stregatto (open source python framework)
Crea il tuo assistente AI con lo Stregatto (open source python framework)Crea il tuo assistente AI con lo Stregatto (open source python framework)
Crea il tuo assistente AI con lo Stregatto (open source python framework)Commit University
 
Do we need a new standard for visualizing the invisible?
Do we need a new standard for visualizing the invisible?Do we need a new standard for visualizing the invisible?
Do we need a new standard for visualizing the invisible?SANGHEE SHIN
 
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...Aggregage
 
Spring24-Release Overview - Wellingtion User Group-1.pdf
Spring24-Release Overview - Wellingtion User Group-1.pdfSpring24-Release Overview - Wellingtion User Group-1.pdf
Spring24-Release Overview - Wellingtion User Group-1.pdfAnna Loughnan Colquhoun
 
COMPUTER 10 Lesson 8 - Building a Website
COMPUTER 10 Lesson 8 - Building a WebsiteCOMPUTER 10 Lesson 8 - Building a Website
COMPUTER 10 Lesson 8 - Building a Websitedgelyza
 
UiPath Platform: The Backend Engine Powering Your Automation - Session 1
UiPath Platform: The Backend Engine Powering Your Automation - Session 1UiPath Platform: The Backend Engine Powering Your Automation - Session 1
UiPath Platform: The Backend Engine Powering Your Automation - Session 1DianaGray10
 
Basic Building Blocks of Internet of Things.
Basic Building Blocks of Internet of Things.Basic Building Blocks of Internet of Things.
Basic Building Blocks of Internet of Things.YounusS2
 
9 Steps For Building Winning Founding Team
9 Steps For Building Winning Founding Team9 Steps For Building Winning Founding Team
9 Steps For Building Winning Founding TeamAdam Moalla
 
RAG Patterns and Vector Search in Generative AI
RAG Patterns and Vector Search in Generative AIRAG Patterns and Vector Search in Generative AI
RAG Patterns and Vector Search in Generative AIUdaiappa Ramachandran
 
UiPath Studio Web workshop series - Day 6
UiPath Studio Web workshop series - Day 6UiPath Studio Web workshop series - Day 6
UiPath Studio Web workshop series - Day 6DianaGray10
 
NIST Cybersecurity Framework (CSF) 2.0 Workshop
NIST Cybersecurity Framework (CSF) 2.0 WorkshopNIST Cybersecurity Framework (CSF) 2.0 Workshop
NIST Cybersecurity Framework (CSF) 2.0 WorkshopBachir Benyammi
 
Digital magic. A small project for controlling smart light bulbs.
Digital magic. A small project for controlling smart light bulbs.Digital magic. A small project for controlling smart light bulbs.
Digital magic. A small project for controlling smart light bulbs.francesco barbera
 
AI Fame Rush Review – Virtual Influencer Creation In Just Minutes
AI Fame Rush Review – Virtual Influencer Creation In Just MinutesAI Fame Rush Review – Virtual Influencer Creation In Just Minutes
AI Fame Rush Review – Virtual Influencer Creation In Just MinutesMd Hossain Ali
 
Empowering Africa's Next Generation: The AI Leadership Blueprint
Empowering Africa's Next Generation: The AI Leadership BlueprintEmpowering Africa's Next Generation: The AI Leadership Blueprint
Empowering Africa's Next Generation: The AI Leadership BlueprintMahmoud Rabie
 
Salesforce Miami User Group Event - 1st Quarter 2024
Salesforce Miami User Group Event - 1st Quarter 2024Salesforce Miami User Group Event - 1st Quarter 2024
Salesforce Miami User Group Event - 1st Quarter 2024SkyPlanner
 
OpenShift Commons Paris - Choose Your Own Observability Adventure
OpenShift Commons Paris - Choose Your Own Observability AdventureOpenShift Commons Paris - Choose Your Own Observability Adventure
OpenShift Commons Paris - Choose Your Own Observability AdventureEric D. Schabell
 
IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019
IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019
IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019IES VE
 
UiPath Studio Web workshop series - Day 7
UiPath Studio Web workshop series - Day 7UiPath Studio Web workshop series - Day 7
UiPath Studio Web workshop series - Day 7DianaGray10
 
Linked Data in Production: Moving Beyond Ontologies
Linked Data in Production: Moving Beyond OntologiesLinked Data in Production: Moving Beyond Ontologies
Linked Data in Production: Moving Beyond OntologiesDavid Newbury
 

Recently uploaded (20)

Meet the new FSP 3000 M-Flex800™
Meet the new FSP 3000 M-Flex800™Meet the new FSP 3000 M-Flex800™
Meet the new FSP 3000 M-Flex800™
 
Crea il tuo assistente AI con lo Stregatto (open source python framework)
Crea il tuo assistente AI con lo Stregatto (open source python framework)Crea il tuo assistente AI con lo Stregatto (open source python framework)
Crea il tuo assistente AI con lo Stregatto (open source python framework)
 
Do we need a new standard for visualizing the invisible?
Do we need a new standard for visualizing the invisible?Do we need a new standard for visualizing the invisible?
Do we need a new standard for visualizing the invisible?
 
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...
 
Spring24-Release Overview - Wellingtion User Group-1.pdf
Spring24-Release Overview - Wellingtion User Group-1.pdfSpring24-Release Overview - Wellingtion User Group-1.pdf
Spring24-Release Overview - Wellingtion User Group-1.pdf
 
COMPUTER 10 Lesson 8 - Building a Website
COMPUTER 10 Lesson 8 - Building a WebsiteCOMPUTER 10 Lesson 8 - Building a Website
COMPUTER 10 Lesson 8 - Building a Website
 
UiPath Platform: The Backend Engine Powering Your Automation - Session 1
UiPath Platform: The Backend Engine Powering Your Automation - Session 1UiPath Platform: The Backend Engine Powering Your Automation - Session 1
UiPath Platform: The Backend Engine Powering Your Automation - Session 1
 
Basic Building Blocks of Internet of Things.
Basic Building Blocks of Internet of Things.Basic Building Blocks of Internet of Things.
Basic Building Blocks of Internet of Things.
 
9 Steps For Building Winning Founding Team
9 Steps For Building Winning Founding Team9 Steps For Building Winning Founding Team
9 Steps For Building Winning Founding Team
 
RAG Patterns and Vector Search in Generative AI
RAG Patterns and Vector Search in Generative AIRAG Patterns and Vector Search in Generative AI
RAG Patterns and Vector Search in Generative AI
 
UiPath Studio Web workshop series - Day 6
UiPath Studio Web workshop series - Day 6UiPath Studio Web workshop series - Day 6
UiPath Studio Web workshop series - Day 6
 
NIST Cybersecurity Framework (CSF) 2.0 Workshop
NIST Cybersecurity Framework (CSF) 2.0 WorkshopNIST Cybersecurity Framework (CSF) 2.0 Workshop
NIST Cybersecurity Framework (CSF) 2.0 Workshop
 
Digital magic. A small project for controlling smart light bulbs.
Digital magic. A small project for controlling smart light bulbs.Digital magic. A small project for controlling smart light bulbs.
Digital magic. A small project for controlling smart light bulbs.
 
AI Fame Rush Review – Virtual Influencer Creation In Just Minutes
AI Fame Rush Review – Virtual Influencer Creation In Just MinutesAI Fame Rush Review – Virtual Influencer Creation In Just Minutes
AI Fame Rush Review – Virtual Influencer Creation In Just Minutes
 
Empowering Africa's Next Generation: The AI Leadership Blueprint
Empowering Africa's Next Generation: The AI Leadership BlueprintEmpowering Africa's Next Generation: The AI Leadership Blueprint
Empowering Africa's Next Generation: The AI Leadership Blueprint
 
Salesforce Miami User Group Event - 1st Quarter 2024
Salesforce Miami User Group Event - 1st Quarter 2024Salesforce Miami User Group Event - 1st Quarter 2024
Salesforce Miami User Group Event - 1st Quarter 2024
 
OpenShift Commons Paris - Choose Your Own Observability Adventure
OpenShift Commons Paris - Choose Your Own Observability AdventureOpenShift Commons Paris - Choose Your Own Observability Adventure
OpenShift Commons Paris - Choose Your Own Observability Adventure
 
IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019
IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019
IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019
 
UiPath Studio Web workshop series - Day 7
UiPath Studio Web workshop series - Day 7UiPath Studio Web workshop series - Day 7
UiPath Studio Web workshop series - Day 7
 
Linked Data in Production: Moving Beyond Ontologies
Linked Data in Production: Moving Beyond OntologiesLinked Data in Production: Moving Beyond Ontologies
Linked Data in Production: Moving Beyond Ontologies
 

SlideShare Instant

  • 1. Creating SlideShare Instant Demo : http://home.iitb.ac.in/~saket.kumar/slideshare Source:https://github.com/saketkc/SlideShare-Instant t Saket Choudhary http://home.iitb.ac.in/~saket.kumar IIT Bombay
  • 2. What is “Instant”? 1.Get spontaneous results “on the go” while you type. 2.Saves time 3.First results are generally preffered reults hence search the “browsing Example: 1. Google Search Instant(Results appear as you type) 2. YouTube Instant : The thing that actually landd up its creator with a job offer !
  • 3. SlideShare Instant ! Get instant results for your Slide/Document Search ! Not Satisfied with the first result?? Go Click the “Next” button ! Not So Fast Yet ! Well the source code is all open Go edit it ! Just Respect the Open Source Terms: https://github.com/saketkc/SlideShare-Instant Demo available at: http://home.iitb.ac.in/~saket.kumar/slideshare
  • 4. Requirements 1.AJAX calls (Hail Google !) 2.PHP ( My favourite on Web So far ! I am falling in love with RoR though) 3. Javascript(jquery) 4. CSS (Brains with Beauty is the way everyonr likes it ! )
  • 5. Code Snippets <input type=&quot;text&quot; class='search_input' /><br/> Define an “onkeyup” event sen an ajax GET request to 'ajax.php' containing the parameters: the 'ajaxeeequest' and 'query' $(&quot;.search_input&quot;).keyup(function() { var search_input = $(this).val(); var keyword= encodeURIComponent(search_input); $.ajax({ type: &quot;GET&quot;, url: &quot;ajax.php&quot;, data:{'op':'ajaxrequest','query':keyword}, success: function(msg){ $('.inner').html(msg); //fetch the Slide and echo it on the page } }); });
  • 6. Contact Me I am a Sophomore at IIT Bombay as of 2011 . I can be contacted at [email_address]
  • 7. Ajax.php <?php session_start(); $var=array(); global $vaar; //$var=[]; if ($_GET['op']==&quot;ajaxrequest&quot;) {$var=$_GET['query']; $api_key=&quot;8GD14Jk1&quot;; $secret=&quot;mnFaUN4s&quot;; $proxy=&quot;proxy&quot;; $pass=&quot;user:pwd&quot;; $timeout=0; $ts=time(); $hash=sha1($secret.$ts); # use CURL library to fetch remote file $apiurl=&quot;http://www.slideshare.net/api/2/search_slideshows?q=$var&quot;; $ch = curl_init(); curl_setopt ($ch, CURLOPT_RETURNTRANSFER,1);
  • 8. curl_setopt($ch, CURLOPT_PROXY, $proxy); curl_setopt($ch, CURLOPT_PROXYPORT,80); curl_setopt($ch, CURLOPT_PROXYUSERPWD,$pass); $url = $apiurl.&quot;&api_key=$api_key&ts=$ts&hash=$hash&items_per_page=1&quot;; curl_setopt ($ch, CURLOPT_URL, $url); $file_contents = curl_exec($ch); $xml = simplexml_load_string($file_contents); $number=1; foreach ( $xml->Slideshow as $files) { $_SESSION[$var][$number]=$files->Embed; //echo $_SESSION['sad']['2']; $vaar[$number]=$_SESSION[$var][$number]; echo ($vaar[$number]); $number=$number+1; } }
  • 9. if ($_GET['op']==&quot;numberrequest&quot;) { // session_start(); $num=$_GET['number']; $query=$_GET['query']; $api_key=&quot;8GD14Jk1&quot;; $secret=&quot;mnFaUN4s&quot;; $proxy=”proxy” $pass=&quot;user:pwd”; $timeout=0; $ts=time(); $hash=sha1($secret.$ts); # use CURL library to fetch remote file $apiurl=&quot;http://www.slideshare.net/api/2/search_slideshows?q=$query&quot;;
  • 10. $ch = curl_init(); curl_setopt ($ch, CURLOPT_RETURNTRANSFER,1); curl_setopt($ch, CURLOPT_PROXY, $proxy); curl_setopt($ch, CURLOPT_PROXYPORT,80); curl_setopt($ch, CURLOPT_PROXYUSERPWD,$pass); $url = $apiurl.&quot;&api_key=$api_key&ts=$ts&hash=$hash&items_per_page=$num&quot;; curl_setopt ($ch, CURLOPT_URL, $url); $file_contents = curl_exec($ch); //$res = simplexml_load_file($file_contents); $xml = simplexml_load_string($file_contents); $number=1; foreach ( $xml->Slideshow as $files) { $_SESSION[$var][$number]=$files->Embed; $vaar[$number]=$_SESSION[$var][$number]; if ($number==$num) { echo $files->Embed; } $number=$number+1; }} ?>
  • 11. Index.php <!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;> <html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;> <head> <meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=iso-8859-1&quot; /> <LINK href=&quot;style.css&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot;> <title>SlideShare Instant</title> <script type=&quot;text/javascript&quot; src=&quot;http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js&quot;></script> <script src=&quot;http://chrisslidesharehacks.googlecode.com/files/previewer2.js&quot;></script> <script type=&quot;text/javascript&quot;> $(document).ready(function() { var number=01; $(&quot;.search_input&quot;).focus(); $(&quot;.search_input&quot;).keyup(function() { var search_input = $(this).val(); var keyword= encodeURIComponent(search_input); $.ajax({ type: &quot;GET&quot;, url: &quot;ajax.php&quot;, data:{'op':'ajaxrequest','query':keyword}, success: function(msg){ $('.inner').html(msg); } }); });
  • 12. $('#next').click(function() { number=number+1; var keyword = $(&quot;.search_input&quot;).val(); $.ajax({ type: &quot;GET&quot;, url: &quot;ajax.php&quot;, data:{'op':'numberrequest','query':keyword,'number':number}, success: function(msg){ $('.inner').html(msg);//=msg; } }); }); $('#prev').click(function() { number=number-1; var keyword = $(&quot;.search_input&quot;).val();
  • 13. $.ajax({ type: &quot;GET&quot;, url: &quot;ajax.php&quot;, data:{'op':'numberrequest','query':keyword,'number':number}, success: function(msg){ $('.inner').html(msg);//=msg; } }); }); }); </script> <body> <center> SlideShare Instant Query<input type=&quot;text&quot; class='search_input' /><br/> <div class=&quot;container&quot;> <div class=&quot;inner&quot;></div> <button id=&quot;next&quot;> Next--</div> <button id=&quot;prev&quot;>--Prev</div> </div> </center> </body>