开发者

Google spreadsheet with hyperlinks via JSON

开发者 https://www.devze.com 2023-03-16 19:29 出处:网络
I\'m using json-in-script to put content from a Google Spreadsheet on a web page. The spreadsheet has hyperlinks on some of the text in the cells. JSON doesn\'t seem to be getting anything other than

I'm using json-in-script to put content from a Google Spreadsheet on a web page. The spreadsheet has hyperlinks on some of the text in the cells. JSON doesn't seem to be getting anything other than the plain text of the spreadsheet, and no markup like hyperlinks. How do you get hyperlinks? Can you with JSON?

This is the src of what I'm importing:

http://spreadsheets.google.com/feeds/cells/0Aipg92XowKCndHhtbnZXQkllWEUzUjBEc3NkQXppdnc/1/public/values?alt=json-in-script&callback=cellEntries&min-row=2&min-col=1&max-col=7

This is the l开发者_开发百科ink to the spreadsheet (see how the items in col1 are linked?)

https://spreadsheets.google.com/spreadsheet/pub?hl=en_US&hl=en_US&key=0Aipg92XowKCndHhtbnZXQkllWEUzUjBEc3NkQXppdnc&output=html

Can anyone advise me how to get the hyperlinks?

Thanks!


You'll want to do some post-processing, checking if a value matches a URL. If it does, create your own tag for it.

Use one of these:

http://www.google.com/search?q=url+regex

Also, you know that you can embed Google Spreadsheets directly in a webpage? I'm guessing you're not doing this because it would use an iFrame, and what you want is the actual data?


Rather than using the Google Speadsheets API (which is quite cumbersome), you should use jsondata.com. It'll let you upload all the data from a .csv and embed it in your site with YouTube-style embed code.

The post processing is a piece of cake when you get your entire dataset to your application in a nicely formatted JSON object.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号