SlideShare uma empresa Scribd logo
1 de 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>

Mais conteúdo relacionado

Mais procurados

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
 

Mais procurados (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!
 

Destaque (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]
 

Semelhante a 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 for Joomla!
Flash templates for Joomla!Flash templates for Joomla!
Flash templates for Joomla!Herman Peeren
 
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
 
PHP Presentation
PHP PresentationPHP Presentation
PHP PresentationNikhil Jain
 
Forum Presentation
Forum PresentationForum Presentation
Forum PresentationAngus Pratt
 

Semelhante a 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 for Joomla!
Flash templates for Joomla!Flash templates for Joomla!
Flash templates for Joomla!
 
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
 
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
 

Mais de 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
 

Último

Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesBoston Institute of Analytics
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsRoshan Dwivedi
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 

Último (20)

Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 

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>