SlideShare ist ein Scribd-Unternehmen logo
1 von 13
Downloaden Sie, um offline zu lesen
Creating SlideShare Instant
   Demo: http://home.iitb.ac.in/~saket.kumar/slideshare
  Source:https://github.com/saketkc/SlideShare-Instantt




         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="text" class='search_input' /><br/>

Define an “onkeyup” event sen an ajax GET request to 'ajax.php'
   containing the parameters: the 'ajaxeeequest' and 'query'

              $(".search_input").keyup(function()
                                  {
                var search_input = $(this).val();
     var keyword= encodeURIComponent(search_input);
                              $.ajax({
                            type: "GET",
                          url: "ajax.php",
            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
   saketkc@gmail.com
Ajax.php
<?php
session_start();
$var=array();
global $vaar;
//$var=[];
if ($_GET['op']=="ajaxrequest")
{$var=$_GET['query'];


$api_key="8GD14Jk1";
$secret="mnFaUN4s";

$proxy="proxy";
$pass="user:pwd";
$timeout=0;
$ts=time();
$hash=sha1($secret.$ts);
# use CURL library to fetch remote file
$apiurl="http://www.slideshare.net/api/2/search_slideshows?q=$var";
$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."&api_key=$api_key&ts=$ts&hash=$hash&items_per_page=1";
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']=="numberrequest")
{
// session_start();
$num=$_GET['number'];
$query=$_GET['query'];


$api_key="8GD14Jk1";
$secret="mnFaUN4s";

$proxy=”proxy”
$pass="user:pwd”;
$timeout=0;
$ts=time();
$hash=sha1($secret.$ts);
# use CURL library to fetch remote file
$apiurl="http://www.slideshare.net/api/2/search_slideshows?q=$query";
$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."&api_key=$api_key&ts=$ts&hash=$hash&items_per_page=$num";
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;
}}

?>
<script type="text/javascript"
src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></scrip
t>
<script
src="http://chrisslidesharehacks.googlecode.com/files/previewer2.js"></scr
ipt>
<script type="text/javascript">
$(document).ready(function()
{
var number=01;
$(".search_input").focus();
$(".search_input").keyup(function()
{
var search_input = $(this).val();
var keyword= encodeURIComponent(search_input);
$.ajax({
   type: "GET",
   url: "ajax.php",
   data:{'op':'ajaxrequest','query':keyword},
   success: function(msg){
     $('.inner').html(msg);
       }
 });
});
$('#next').click(function() {
  number=number+1;
  var keyword = $(".search_input").val();
  $.ajax({
   type: "GET",
   url: "ajax.php",
   data:{'op':'numberrequest','query':keyword,'number':number},
   success: function(msg){
     $('.inner').html(msg);//=msg;
   }
 });
});
$('#prev').click(function() {

 number=number-1;
 var keyword = $(".search_input").val();
$.ajax({
   type: "GET",
   url: "ajax.php",
   data:{'op':'numberrequest','query':keyword,'number':number},
   success: function(msg){
     $('.inner').html(msg);//=msg;
    }
 });
});
});
</script>
<body>
<center>
SlideShare Instant Query<input type="text" class='search_input' /><br/>
<div class="container">
<div class="inner"></div>
<button id="next"> Next--</div>
<button id="prev">--Prev</div>
</div>
</center>
</body>

Weitere ähnliche Inhalte

Andere mochten auch

Andere mochten auch (10)

SlideShare Instant
SlideShare InstantSlideShare Instant
SlideShare Instant
 
Equips de 4 t
Equips de 4 tEquips de 4 t
Equips de 4 t
 
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
 
CL 324 PRoj
CL 324 PRojCL 324 PRoj
CL 324 PRoj
 
Pattern Recognition in Clinical Data
Pattern Recognition in Clinical DataPattern Recognition in Clinical Data
Pattern Recognition in Clinical Data
 
Global_Health_and_Intersectoral_Collaboration
Global_Health_and_Intersectoral_CollaborationGlobal_Health_and_Intersectoral_Collaboration
Global_Health_and_Intersectoral_Collaboration
 
SlideShare Instant
SlideShare InstantSlideShare Instant
SlideShare Instant
 
Sniffer[1]
Sniffer[1]Sniffer[1]
Sniffer[1]
 

Mehr von 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
 

Kürzlich hochgeladen

Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
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
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
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
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
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
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
"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
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
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
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 

Kürzlich hochgeladen (20)

Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
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
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
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
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
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
 
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
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
"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...
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
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
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 

SlideShare Instant