Tuesday, 5 July 2016

Useful Daily Batch Scripts For Windows-PC UTILITIES

echo off
menu
cls
echo --------------------------------------------------------------------------------
echo PC Cleanup Utility
echo --------------------------------------------------------------------------------
echo.
echo Select a tool
echo =============
echo.
echo [1] Delete Internet Cookies
echo [2] Delete Temporary Internet Files
echo [3] Disk Cleanup
echo [4] Disk Defragment
echo [5] Exit
echo.
set /p op=Run:
if %op%==1 goto 1
if %op%==2 goto 2
if %op%==3 goto 3
if %op%==4 goto 4
if %op%==5 goto exit
goto error
:1
cls
echo --------------------------------------------------------------------------------
echo Delete Internet Cookies
echo --------------------------------------------------------------------------------
echo.
echo Deleting Cookies...
ping localhost -n 3 >nul
del /f /q "%userprofile%\Cookies\*.*"
cls
echo --------------------------------------------------------------------------------
echo Delete Internet Cookies
echo --------------------------------------------------------------------------------
echo.
echo Cookies deleted.
echo.
echo Press any key to return to the menu. . .
pause >nul
goto menu
:2
cls
echo --------------------------------------------------------------------------------
echo Delete Temporary Internet Files
echo --------------------------------------------------------------------------------
echo.
echo Deleting Temporary Files...
ping localhost -n 3 >nul
del /f /q "%userprofile%\AppData\Local\Microsoft\Windows\Temporary Internet Files\*.*"
cls
echo --------------------------------------------------------------------------------
echo Delete Temporary Internet Files
echo --------------------------------------------------------------------------------
echo.
echo Temporary Internet Files deleted.
echo.
echo Press any key to return to the menu. . .
pause >nul
goto menu
:3
cls
echo --------------------------------------------------------------------------------
echo Disk Cleanup
echo --------------------------------------------------------------------------------
echo.
echo Running Disk Cleanup...
ping localhost -n 3 >nul
if exist "C:\WINDOWS\temp"del /f /q "C:WINDOWS\temp\*.*"
if exist "C:\WINDOWS\tmp" del /f /q "C:\WINDOWS\tmp\*.*"
if exist "C:\tmp" del /f /q "C:\tmp\*.*"
if exist "C:\temp" del /f /q "C:\temp\*.*"
if exist "%temp%" del /f /q "%temp%\*.*"
if exist "%tmp%" del /f /q "%tmp%\*.*"
if not exist "C:\WINDOWS\Users\*.*" goto skip
if exist "C:\WINDOWS\Users\*.zip" del "C:\WINDOWS\Users\*.zip" /f /q
if exist "C:\WINDOWS\Users\*.exe" del "C:\WINDOWS\Users\*.exe" /f /q
if exist "C:\WINDOWS\Users\*.gif" del "C:\WINDOWS\Users\*.gif" /f /q
if exist "C:\WINDOWS\Users\*.jpg" del "C:\WINDOWS\Users\*.jpg" /f /q
if exist "C:\WINDOWS\Users\*.png" del "C:\WINDOWS\Users\*.png" /f /q
if exist "C:\WINDOWS\Users\*.bmp" del "C:\WINDOWS\Users\*.bmp" /f /q
if exist "C:\WINDOWS\Users\*.avi" del "C:\WINDOWS\Users\*.avi" /f /q
if exist "C:\WINDOWS\Users\*.mpg" del "C:\WINDOWS\Users\*.mpg" /f /q
if exist "C:\WINDOWS\Users\*.mpeg" del "C:\WINDOWS\Users\*.mpeg" /f /q
if exist "C:\WINDOWS\Users\*.ra" del "C:\WINDOWS\Users\*.ra" /f /q
if exist "C:\WINDOWS\Users\*.ram" del "C:\WINDOWS\Users\*.ram"/f /q
if exist "C:\WINDOWS\Users\*.mp3" del "C:\WINDOWS\Users\*.mp3" /f /q
if exist "C:\WINDOWS\Users\*.mov" del "C:\WINDOWS\Users\*.mov" /f /q
if exist "C:\WINDOWS\Users\*.qt" del "C:\WINDOWS\Users\*.qt" /f /q
if exist "C:\WINDOWS\Users\*.asf" del "C:\WINDOWS\Users\*.asf" /f /q
:skip
if not exist C:\WINDOWS\Users\Users\*.* goto skippy /f /q
if exist C:\WINDOWS\Users\AppData\Temp\*.zip del C:\WINDOWS\Users\Users\*.zip /f /q
if exist C:\WINDOWS\Users\AppData\Temp\*.exe del C:\WINDOWS\Users\Users\*.exe /f /q
if exist C:\WINDOWS\Users\AppData\Temp\*.gif del C:\WINDOWS\Users\Users\*.gif /f /q
if exist C:\WINDOWS\Users\AppData\Temp\*.jpg del C:\WINDOWS\Users\Users\*.jpg /f /q
if exist C:\WINDOWS\Users\AppData\Temp\*.png del C:\WINDOWS\Users\Users\*.png /f /q
if exist C:\WINDOWS\Users\AppData\Temp\*.bmp del C:\WINDOWS\Users\Users\*.bmp /f /q
if exist C:\WINDOWS\Users\AppData\Temp\*.avi del C:\WINDOWS\Users\Users\*.avi /f /q
if exist C:\WINDOWS\Users\AppData\Temp\*.mpg del C:\WINDOWS\Users\Users\*.mpg /f /q
if exist C:\WINDOWS\Users\AppData\Temp\*.mpeg del C:\WINDOWS\Users\Users\*.mpeg /f /q
if exist C:\WINDOWS\Users\AppData\Temp\*.ra del C:\WINDOWS\Users\Users\*.ra /f /q
if exist C:\WINDOWS\Users\AppData\Temp\*.ram del C:\WINDOWS\Users\Users\*.ram /f /q
if exist C:\WINDOWS\Users\AppData\Temp\*.mp3 del C:\WINDOWS\Users\Users\*.mp3 /f /q
if exist C:\WINDOWS\Users\AppData\Temp\*.asf del C:\WINDOWS\Users\Users\*.asf /f /q
if exist C:\WINDOWS\Users\AppData\Temp\*.qt del C:\WINDOWS\Users\Users\*.qt /f /q
if exist C:\WINDOWS\Users\AppData\Temp\*.mov del C:\WINDOWS\Users\Users\*.mov /f /q
:skippy
if exist "C:\WINDOWS\ff*.tmp" del C:\WINDOWS\ff*.tmp /f /q
if exist C:\WINDOWS\ShellIconCache del /f /q "C:\WINDOWS\ShellI~1\*.*"
cls
echo --------------------------------------------------------------------------------
echo Disk Cleanup
echo --------------------------------------------------------------------------------
echo.
echo Disk Cleanup successful!
echo.
pause
goto menu
:4
cls
echo --------------------------------------------------------------------------------
echo Disk Defragment
echo --------------------------------------------------------------------------------
echo.
echo Defragmenting hard disks...
ping localhost -n 3 >nul
defrag -c -v
cls
echo --------------------------------------------------------------------------------
echo Disk Defragment
echo --------------------------------------------------------------------------------
echo.
echo Disk Defrag successful!
echo.
pause
goto menu
:error
cls
echo Command not recognized.
ping localhost -n 4 >nul
goto menu
:exit



ping 127.0.0.1 >nul
exit

Friday, 29 April 2016

How To Fetch All the uploads Of a Channel Of your Wise using YouTube Data API v3 ?????




In this post , I would like to share  ,how could anyone can fetch all the channel uploads without moving through all the videos to find the right video for you to watch.

This requires Simple steps which are as follows :

1. firstly, you need to sign-in to the Google Developers Console with any of yours Gmail acccount.

2. Then create a project over YouTube Data API.

3. Then  You guys need to a need to create an API key.

and you are set to go!!!..

This entire thing is only based on JAVASCRIPT. Go the Entire Code.. ANY QUESTION YOU HAVE JUST COMMENT IT..


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled Document</title>
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
    <script type="text/javascript">

      pid = '';
      $(document).ready(function(){
        $.get(
          "https://www.googleapis.com/youtube/v3/channels", {
            part: 'contentDetails',
            forUsername : 'GoogleDevelopers',  /*This is the channel name from which you want to fetch data */
key : 'AIzaSyBtk260O3v15xe6lSTHMlYOrLXf8XPGLw8' /* This is the API key..you guys need to change it with yours API Key*/
          },
        function(data){
          $.each(data.items, function(i, item){
            console.log(item);
            pid = item.contentDetails.relatedPlaylists.uploads;
            getVids(pid);
          })
        });

      });
      function getVids(pid, pageToken){
        var data = {
          part: 'snippet',
          maxResults: 50,
          playlistId: pid,
          key : 'AIzaSyBtk260O3v15xe6lSTHMlYOrLXf8XPGLw8'
        }
     
        try{
          if(pageToken){
            data["pageToken"] = pageToken;
          }
        }catch(err){
        }

        $.get(
          "https://www.googleapis.com/youtube/v3/playlistItems", data,
          function(data){
            var output;

            $('#results').html("");
            $.each(data.items, function(i, item){
              console.log(item);
              videoTitle = item.snippet.title;
              rvideoID = item.snippet.resourceId.videoId;
              vidThumburl = item.snippet.thumbnails.high.url;
              output = '<li style="list-style:none;"><a class="videos2 video" href="https://www.youtube.com/watch?v=' + rvideoID + '">' + videoTitle + '<a/></li>';
              //Append to results list
              $('#results').append(output);
            });

'<br/>'
'<br/>'

            try{
              if(data.prevPageToken){
                $("#results").append('<li style="list-style:none;"><a class="" href="javascript:void(0);" onclick="javascript:getVids(pid, \'' + data.prevPageToken + '\');">&raquo; Prev Page<a/></li>');
              }
            }catch(err){
            }

'<br/>'
'<br/>'

            try{
              if(data.nextPageToken){
                $("#results").append('<li style="list-style:none;"><a class="" href="javascript:void(0);" onclick="javascript:getVids(pid, \'' + data.nextPageToken + '\');">Next Page &laquo;<a/></li>');
              }
            }catch(err){
            }
          });
      }
    </script>
  </head>
  <body>
    <div id="container">
      <ul id="results"></ul>
    </div>

  </body>
</html>


Tuesday, 29 March 2016

API - The Engine Behind The Hoods


     What Is An API ???

Connectivity is an  amazing thing. By now we are all use to instant connectivity which puts the worlds in our fingertips in few minutes rather in few seconds from desktops to mobiles or any other portable internet devices. Where we can purchase, post our thoughts, pin our comments and even pick anything from anywhere. So, We are connected to the world like each other like never before.


But does it happens??? How the data gets from here to there ??? How different devices and applications connects with each others???? which allows us to bring the entire world in our pockets in minutes which allows us to place an order, make a reservation for dinner in a restaurant, or even book a flight tickets in few types. The Unseen hero of our Connectivity is:

                  "APPLICATION PROGRAMMING INTERFACE"

The API. as I mentioned in heads, this is the engine under the hoods. which makes life of ours so simple. This is behind the scene that we take for granted which makes possible for all the interaction on the activities which we are reliable on in our day to day life.

So Exactly,  What is an API??????

If anyone asks this question or sees to books or even google it. the Defination goes likes this

"a set of functions and procedures that allow the creation of applications which access the features or data of an operating system, application, or other service.............blahhh blahhhh bllllllllllllllllllaaaaaaaaaaaaaaaaaaahhhhhhhhhhhhh". all this stuffs.. To big words to understand in our small brains. :-)..(Exceptions are always there..).


To speak plainly or simply, API is the messenger that thakes the request from you and tells the system what you want and the returns in the form response back to you.

For Example ,   Thing a waiter in a restaurant is an API. you want to the restaurant and you sit on the table with the menu cards in your hands. Now you can see the kitchen but you are not allowed to enter the kitchen. so here comes the waiter the API over here. the waiter takes the order(request) and takes it to the kitchen and brings the food (repsonse). 

So let bring this API to the real world. When you are booking a flight ticket direct from a flight company website. you just fills ups few fields and it allows you access the flights company database  and returns some information. Now you are booking the same ticket from a different websites like makemytrip.com or goibibo.com etc. you can easily compare the prices. so the website is accessing the database of all the airlines and giving you the results in a split seconds. this is because the website is accessing the API of the respective airlines at same time. 

Now think in this way that all the devices are connected among themselves through API. I hope i am able to make you understand you guys in a simple way!!!!...THANK YOU!!!