વેબને કેપ્ચર અને કન્વર્ટ કરવા માટેનાં સાધનો

GrabzIt ના API માટે પુન Retપ્રાપ્તિ પદ્ધતિઓ

GrabzIt's API માંથી સ્ક્રીનશોટ, ટેબલ કેપ્ચર અને એનિમેટેડ GIF ને પુનઃપ્રાપ્ત કરવા માટે બે પદ્ધતિઓનો ઉપયોગ કરી શકાય છે, જે બંનેના પોતાના ફાયદા અને ગેરફાયદા છે.

અસુમેળ પદ્ધતિ

કૉલબેક પદ્ધતિ

કૉલબેક પદ્ધતિ તરીકે પણ ઓળખાય છે, કેપ્ચર પુનઃપ્રાપ્ત કરવાની આ ભલામણ કરેલ રીત છે. જો કે તેને ડોમેન નામ અથવા સાર્વજનિક રૂપે ઉપલબ્ધ IP સરનામું બનાવવા માટે એપ્લિકેશન બનાવવામાં આવે તે જરૂરી છે. એક ઉદાહરણ આ પદ્ધતિનો ઉપયોગ વેબ એપ્લિકેશન હશે.

ડાયાગ્રામમાં જોઈ શકાય છે કે અસિંક્રોનસ પદ્ધતિ GrabzIt પર કૉલ મોકલીને અને પછી સ્ક્રીનશૉટ તૈયાર છે એમ કહીને એપ્લિકેશન પર પાછા મોકલવામાં આવતા કૉલની રાહ જોઈને કામ કરે છે. આ પદ્ધતિનો ઉપયોગ કરવાનો ફાયદો એ છે કે તેને ઓછા કૉલ્સની જરૂર પડે છે અને અન્ય પ્રક્રિયાઓને મંજૂરી આપે છે, જેમ કે વેબ વિનંતીને આગળ વધવા માટેintફાટી નીકળ્યું

અસુમેળ કૉલનું ઉદાહરણ નીચે દરેક સર્વર સાઇડ લેંગ્વેજ માટે બતાવવામાં આવ્યું છે જે GrabzIt હાલમાં સપોર્ટ કરે છે.

યાદ રાખો કે GrabzIt ના API ને અસુમેળ રીતે કૉલ કરવા માટે તમારે આ ASP.NET ને અમલમાં મૂકવાની જરૂર પડશે હેન્ડલર.

GrabzItClient grabzIt = new GrabzItClient("Sign in to view your Application Key", "Sign in to view your Application Secret");
grabzIt.URLToImage("http://www.spacex.com");
grabzIt.Save("http://www.mywebsite.com/Home/Handler");

યાદ રાખો કે GrabzIt ના API ને અસુમેળ રીતે કૉલ કરવા માટે તમારે આ Java ને અમલમાં મૂકવાની જરૂર પડશે હેન્ડલર.

GrabzItClient grabzIt = new GrabzItClient("Sign in to view your Application Key", "Sign in to view your Application Secret");
grabzIt.URLToImage("http://www.spacex.com");
grabzIt.Save("http://www.mywebsite.com/handler");

યાદ રાખો કે GrabzIt ના API ને અસુમેળ રીતે કૉલ કરવા માટે તમારે આ Node.js ને અમલમાં મૂકવાની જરૂર પડશે હેન્ડલર, જો કે આને Node.js ફંક્શન કૉલબેક્સ સાથે ભેળસેળ ન કરવી જોઈએ. અહીં ચર્ચા કરાયેલા કૉલબૅક્સ પર મોકલવામાં આવેલા HTTP કૉલબૅક્સ છે Intએર્નેટ!

var grabzit = require('grabzit');

var client = new grabzit("Sign in to view your Application Key", "Sign in to view your Application Secret");
client.url_to_image("http://www.spacex.com");
client.save("http://www.example.com/handler", function (error, id){
    if (error != null){
        throw error;
    }
});

યાદ રાખો કે GrabzIt ના API ને અસુમેળ રીતે કૉલ કરવા માટે તમારે આ પર્લને અમલમાં મૂકવાની જરૂર પડશે હેન્ડલર.

$grabzIt = GrabzItClient->new("Sign in to view your Application Key", "Sign in to view your Application Secret");
$grabzIt->URLToImage("http://www.spacex.com");
$grabzIt->Save("http://www.mywebsite.com/handler.pl");

યાદ રાખો કે GrabzIt ના API ને અસુમેળ રીતે કૉલ કરવા માટે તમારે આ PHP ને અમલમાં મૂકવાની જરૂર પડશે હેન્ડલર.

$grabzIt = new \GrabzIt\GrabzItClient("Sign in to view your Application Key", "Sign in to view your Application Secret");
$grabzIt->URLToImage("http://www.spacex.com");
$grabzIt->Save("http://www.mywebsite.com/handler.php");

યાદ રાખો કે GrabzIt ના API ને અસુમેળ રીતે કૉલ કરવા માટે તમારે આ Python ને અમલમાં મૂકવાની જરૂર પડશે હેન્ડલર.

grabzIt = GrabzItClient.GrabzItClient("Sign in to view your Application Key", "Sign in to view your Application Secret")
grabzIt.URLToImage("http://www.spacex.com")
grabzIt.Save("http://www.mywebsite.com/handler.py")

યાદ રાખો કે GrabzIt ના API ને અસુમેળ રીતે કૉલ કરવા માટે તમારે આ રૂબીને અમલમાં મૂકવાની જરૂર પડશે હેન્ડલર.

grabzIt = GrabzIt::Client.new("Sign in to view your Application Key", "Sign in to view your Application Secret")
grabzIt.url_to_image("http://www.spacex.com")
grabzIt.save("http://www.mywebsite.com/handler/index")

સિંક્રનસ પદ્ધતિ

મતદાન પદ્ધતિ

આ પદ્ધતિનો ઉપયોગ ફક્ત ત્યારે જ થવો જોઈએ જો અસુમેળ પદ્ધતિનો ઉપયોગ કરવો શક્ય ન હોય. સિંક્રનસ મેથડ કેપ્ચર બનાવવા માટે GrabzIt પર કૉલ મોકલીને કામ કરે છે, પછી તે તૈયાર ન થાય ત્યાં સુધી દર થોડી સેકન્ડમાં GrabzItનું મતદાન કરે છે, જેમ કે ડાયાગ્રામમાં બતાવ્યા પ્રમાણે.

તૈયાર થઈ ગયા પછી તે હંમેશની જેમ કેપ્ચર ડાઉનલોડ કરે છે. આ તકનીકનો ગેરલાભ એ છે કે તે વર્તમાન પ્રક્રિયાને કેપ્ચર પૂર્ણ ન થાય ત્યાં સુધી રાહ જોવા માટે દબાણ કરે છે, તેથી જ તે વેબ એપ્લિકેશન માટે યોગ્ય નથી. જો કે ફાયદો એ છે કે એપ્લિકેશનને ડોમેન નામ અથવા IP સરનામાની જરૂર નથી અને તેથી તેનો ઉપયોગ ડેસ્કટોપ એપ્લિકેશન્સમાંથી થઈ શકે છે.

દરેક સર્વર સાઇડ લેંગ્વેજ GrabzIt હાલમાં સપોર્ટ કરે છે તે માટે સિંક્રનસ કૉલ કરવામાં આવે છે તેનું ઉદાહરણ નીચે બતાવેલ છે.

GrabzItClient grabzIt = new GrabzItClient("Sign in to view your Application Key", "Sign in to view your Application Secret");
grabzIt.URLToImage("http://www.spacex.com");
grabzIt.SaveTo("spacex.jpg");
GrabzItClient grabzIt = new GrabzItClient("Sign in to view your Application Key", "Sign in to view your Application Secret");
grabzIt.URLToImage("http://www.spacex.com");
grabzIt.SaveTo("spacex.jpg");
<script src="https://cdn.jsdelivr.net/npm/@grabzit/js@3.5.2/grabzit.min.js"></script>
<script>
GrabzIt("Sign in to view your Application Key").ConvertURL("http://www.spacex.com").Create();
</script>
var grabzit = require('grabzit');

var client = new grabzit("Sign in to view your Application Key", "Sign in to view your Application Secret");
client.url_to_image("http://www.spacex.com");
client.save_to("spacex.jpg", function (error, id){
    if (error != null){
        throw error;
    }
});
$grabzIt = GrabzItClient->new("Sign in to view your Application Key", "Sign in to view your Application Secret");
$grabzIt->URLToImage("http://www.spacex.com");
$grabzIt->SaveTo("spacex.jpg");
$grabzIt = new \GrabzIt\GrabzItClient("Sign in to view your Application Key", "Sign in to view your Application Secret");
$grabzIt->URLToImage("http://www.spacex.com");
$grabzIt->SaveTo("spacex.jpg");
grabzIt = GrabzItClient.GrabzItClient("Sign in to view your Application Key", "Sign in to view your Application Secret")
grabzIt.URLToImage("http://www.spacex.com")
grabzIt.SaveTo("spacex.jpg")
grabzIt = GrabzIt::Client.new("Sign in to view your Application Key", "Sign in to view your Application Secret")
grabzIt.url_to_image("http://www.spacex.com")
grabzIt.save_to("spacex.jpg")