Image attached to a bookmark

27 views
Skip to first unread message

Mitch Gordon

unread,
Nov 25, 2013, 1:42:46 PM11/25/13
to spring...@googlegroups.com
All,

I use the SpringPad Chrome plugin to capture links.  When I do this, an image of the full website is created and the URL to this image (on S3) is set as the value of the "Image" property of the created bookmark block.  I'm trying to create bookmarks programatically, using the API.  I'm currently scanning the page the link accesses and finding an image on the page and setting that image's URL to the "image" property of my newly created bookmark, but I am having problems accessing the image after the block is created.

For example,

I tested adding google.com as a bookmark.  When I scanned the page, I located an image at this URL, "www.google.com/images/srpr/logo9w.png".  I created the bookmark and set the image like this:

                        string url = "http://springpad.com/api/users/me/commands";
			string content = "[[\"create\", \"Bookmark\", \"/UUID(" + foo + ")/\"]]";
 
			var response = await OauthService.SendPost(url, content);
 
			content = "[[\"set\",  \"/UUID(" + uuid + ")/\", \"url\", \"" + theUrl + "\"],";
			content += "[\"set\",  \"/UUID(" + uuid + ")/\", \"name\", \"" + title + "\"],";
			content += "[\"set\",  \"/UUID(" + uuid + ")/\", \"text\", \"" + contentTag + "\"],";
			content += "[\"set\",  \"/UUID(" + uuid + ")/\", \"image\", \"" + imageUrl + "\"],";
			content += "[\"set\",  \"/UUID(" + uuid + ")/\", \"workbooks\", [\"" + uuid.Replace("/UUID(", "").Replace(")/", "") + "\"]]]";
 
			response = await OauthService.SendPost(url, content);

Both of these operations complete without and error.

Later, when I retrieve the block, the value of the image property is ""https://springpad-user-data.s3.amazonaws.com/www.google.com/images/srpr/logo9w.png".  If I try to access this URL in the browser, I receive this back...

<Error>
<Code>AccessDenied</Code>
<Message>Access Denied</Message>
<RequestId>1E7047FEA548F848</RequestId>
<HostId>
rO+0TJMLNgkf8j3D2QCIV+uufRi3Btkp4t+rtM0ExlD6wWkryb0SALWtzMQgNsF4
</HostId>
</Error>

So, the questions I have are these.

  1. Is it possible to use the API to generate images of the site being bookmarked and attach them as the value of the "image" property on a bookmark?
  2. If not, what is the proper way to set an image found on the site as the "image" property of the bookmark?
TIA,

Mitch

Chuck Garofalo

unread,
Dec 9, 2013, 1:30:06 PM12/9/13
to spring...@googlegroups.com
Hi Mitch,

I tried this locally and was able to reproduce the problem when the image value being set is not a complete url.  I reproduce the behavior you are describing using this as the image value "www.google.com/images/srpr/logo9w.png" but I do not when I use this "http://www.google.com/images/srpr/logo9w.png".  In other words, make sure there is an "http://" on the url.

I hope this helps.

Regards,
Chuck
Reply all
Reply to author
Forward
0 new messages