SlideShare a Scribd company logo
1 of 13
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

Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 

Recently uploaded (20)

Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 

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>