표준 스크린 샷 기능뿐만 아니라 GrabzIt는 루비 API입니다 개발자가 int응용 프로그램을 연결하여 GrabzIt과 긴밀하게 비교 into 기존 스크린 샷의 상태를 확인하고 GrabzIt이 웹 컨텐츠를 캡처 할 때 사용할 쿠키를 설정하는 등 GrabzIt 서비스의 내부 작동
응용 프로그램은 캡처 상태를 확인해야 할 수도 있습니다. get_status 이 방법은 유용합니다. 캡처와 관련된 오류 메시지를 반환하면서 캡처가 여전히 처리 중이거나 캐시되었는지 또는 만료되었는지를 나타내는 개체를 반환합니다.
grabzItClient = GrabzIt::Client.new("Sign in to view your Application Key", "Sign in to view your Application Secret") status = grabzItClient.get_status(screenShotId) if status.processing #screenshot has not yet been processed end if status.cached #screenshot is still cached by GrabzIt end if status.expired #screenshot is no longer on GrabzIt #Perhaps output status message? raise status.message end
거의 모든 웹 사이트는 쿠키를 사용하여 기능을 제어합니다. 대상 웹 사이트의 웹 사이트 기능을 변경하려면 GrabzIt은 다음 쿠키 메소드를 제공합니다. 이러한 메소드에 사용 가능한 매개 변수에 대한 자세한 정보는 다음을 참조하십시오. 클라이언트 문서.
grabzItClient = GrabzIt::Client.new("Sign in to view your Application Key", "Sign in to view your Application Secret") #gets an array of cookies for google.com cookies = grabzItClient.get_cookies("google.com") #sets a cookie for the google.com domain grabzItClient.set_cookie("MyCookie", "google.com", "Any Value You Like") #deletes the previously set cookie grabzItClient.delete_cookie("MyCookie", "google.com")
캡처를 사용하기 전에 웹 서버로 다운로드하는 것이 좋습니다. 그러나 웹 서버에 먼저 다운로드하지 않고도 사용자의 브라우저에 모든 유형의 캡처를 표시 할 수 있습니다.
이렇게하려면 캡처가 완료된 후 캡처 한 바이트를 보낼 수 있습니다. save_to 방법 응답과 함께 올바른 마임 유형.
grabzItClient = GrabzIt::Client.new("Sign in to view your Application Key", "Sign in to view your Application Secret") grabzItClient.url_to_image("https://www.tesla.com") capture = grabzItClient.save_to();
위의 예에서는 캡처 바이트를 가져 오지만 응답으로 리턴되는 방법은 사용중인 프레임 워크에 따라 다릅니다.