Thứ Ba, 18 tháng 12, 2012

Crazy Egg API Investigation

More information http://www.crazyegg.com/api

In some instances we may need to create a SHA1 Hex has of the parameters we used, (see http://www.convertstring.com/Hash/SHA1) for example.



GET SNAPSHOTS

We would need to probably call the GET "snapshots.json" endpoint to retrieve a JSON representation of the results from the environment we want to see.

Below is the example request and response.

Request

Request
curl "http://www.crazyegg.com/api/v1/snapshots.json?test=value&api_key=c60432dca0182cbe2d149f3c1aafdc9273b433c0&signed=3fbc8670eb125937bf8b24461408c82bcfe903c6"

Response

  1. [   {"status":"deleted",
  2.     "thumbnail_url":"http://ce2.s3.amazonaws.com/snapshots/383227/report/thumbnail.713f4a6ff7ff3f12a38362b003465dc8.jpg?AWSAccessKeyId=AKIAIYLTGFOK7LMTMNFA&Expires=1353894977&Signature=ewS4Es8bU914lFZXDhStmLWJ7oc%3D",
  3.     "starts_at":null,
  4.     "expires_at":1383152400,
  5.     "source_url":"http://mobile-site-devtest.4impact.net.au/",
  6.     "description":"",
  7.     "processing_status":"idle",
  8.     "screenshot_url":"http://ce2.s3.amazonaws.com/snapshots/383227/report/screenshot.jpg?AWSAccessKeyId=AKIAIYLTGFOK7LMTMNFA&Expires=1353894977&Signature=s06uY6ulZbaE5nMY5TqZWajmc%2FM%3D",
  9.     "name":"Mobile 4impact Site",
  10.     "heatmap_url":"http://ce2.s3.amazonaws.com/snapshots/383227/report/heatmap.jpg?AWSAccessKeyId=AKIAIYLTGFOK7LMTMNFA&Expires=1353894977&Signature=flrTLDMS0HAel9eFW1wb5TbaVRQ%3D",
  11.     "id":383227,
  12.     "screenshot_status":"processed"},
  13.     {"status":"active",
  14.     "thumbnail_url":"http://ce2.s3.amazonaws.com/snapshots/383236/report/thumbnail.555507f85dad1ae3c46f11ecd2fd4b88.jpg?AWSAccessKeyId=AKIAIYLTGFOK7LMTMNFA&Expires=1353894977&Signature=uOEHAAKn6ty0DWS5OzF9NnduY3c%3D",
  15.     "starts_at":null,
  16.     "expires_at":1383152400,
  17.     "source_url":"http://mobile-site-dev.4impact.net.au/",
  18.     "description":"tracking for http://mobile-site-dev.4impact.net.au/ ",
  19.     "processing_status":"processing",
  20.     "screenshot_url":"http://ce2.s3.amazonaws.com/snapshots/383236/report/screenshot.jpg?AWSAccessKeyId=AKIAIYLTGFOK7LMTMNFA&Expires=1353894977&Signature=8TEsq19mriZqchosHkAUlcHZoQI%3D",
  21.     "name":"Mobile 4impact Site","heatmap_url":"http://ce2.s3.amazonaws.com/snapshots/383236/report/heatmap.jpg?AWSAccessKeyId=AKIAIYLTGFOK7LMTMNFA&Expires=1353894977&Signature=mvxmGPzpxNGINI1qqsp4WvJQaR4%3D",
  22.     "id":383236,
  23.     "screenshot_status":"processed"},
  24.     {"status":"active",
  25.     "thumbnail_url":"http://ce2.s3.amazonaws.com/snapshots/383835/report/thumbnail.70ead7fb14e219654929199b617798de.jpg?AWSAccessKeyId=AKIAIYLTGFOK7LMTMNFA&Expires=1353894977&Signature=FmsmGnCcZ6hwJ6aBlhKs7aZgB%2FI%3D",
  26.     "starts_at":null,
  27.     "expires_at":1383238800,
  28.     "source_url":"http://mobile-site-test.4impact.net.au/",
  29.     "description":"tracking for http://mobile-site-test.4impact.net.au/",
  30.     "processing_status":"processing",
  31.     "screenshot_url":"http://ce2.s3.amazonaws.com/snapshots/383835/report/screenshot.jpg?AWSAccessKeyId=AKIAIYLTGFOK7LMTMNFA&Expires=1353894977&Signature=EoNVJYyEk1GsLf32Ms9t3304mXQ%3D",
  32.     "name":"Mobile 4impact Site",
  33.     "heatmap_url":"http://ce2.s3.amazonaws.com/snapshots/383835/report/heatmap.jpg?AWSAccessKeyId=AKIAIYLTGFOK7LMTMNFA&Expires=1353894977&Signature=CbvaNaCra%2BCAnKMDjaKO7faYLNc%3D",
  34.     "id":383835,
  35.     "screenshot_status":"processed"},
  36.     {"status":"active",
  37.     "thumbnail_url":"http://ce2.s3.amazonaws.com/snapshots/383837/report/thumbnail.d0ca3f08cfb747c9a2f57fbbb5983779.jpg?AWSAccessKeyId=AKIAIYLTGFOK7LMTMNFA&Expires=1353894977&Signature=r%2BwiJnn9SGW8%2Be2A5xYkwNYi5oo%3D",
  38.     "starts_at":null,
  39.     "expires_at":1383238800,
  40.     "source_url":"http://mobile-site-showcase.4impact.net.au/",
  41.     "description":"tracking for http://mobile-site-showcase.4impact.net.au/",
  42.     "processing_status":"idle",
  43.     "screenshot_url":"http://ce2.s3.amazonaws.com/snapshots/383837/report/screenshot.jpg?AWSAccessKeyId=AKIAIYLTGFOK7LMTMNFA&Expires=1353894977&Signature=lWQyJfhMRb1gnSKa7HBsItOwbNU%3D",
  44.     "name":"Mobile 4impact Site",
  45.     "heatmap_url":"http://ce2.s3.amazonaws.com/snapshots/383837/report/heatmap.jpg?AWSAccessKeyId=AKIAIYLTGFOK7LMTMNFA&Expires=1353894977&Signature=z7tsHsEmcpqSHXvG3FwJtoQ%2FK30%3D",
  46.     "id":383837,
  47.     "screenshot_status":"processed"}
  48. ]
We would then need to grab the response that was necessary for our environment and overlay the screenshot_url and the heatmap_url to make the heatmap...

Không có nhận xét nào:

Đăng nhận xét

Học lập trình web căn bản với PHP

Bài 1: Các kiến thức căn bản Part 1:  https://jimmyvan88.blogspot.com/2012/05/can-ban-lap-trinh-web-voi-php-bai-1-cac.html Part 2:  https://...