{"id":20962,"date":"2025-07-20T16:24:34","date_gmt":"2025-07-20T15:24:34","guid":{"rendered":"https:\/\/johnjohnston.info\/blog\/?p=20962"},"modified":"2025-07-20T16:30:42","modified_gmt":"2025-07-20T15:30:42","slug":"inaturalist-observations-a-little-ai","status":"publish","type":"post","link":"https:\/\/johnjohnston.info\/blog\/inaturalist-observations-a-little-ai\/","title":{"rendered":"iNaturalist Observations &amp; a little AI"},"content":{"rendered":"\n<p>I&#8217;ve been playing a little with WordPress yesterday. A while back I made the very simplest plugin to display my latest iNaturalist submissions. iNaturalist has a API so I made a short code that would then use JavaScript to pull in the pictures once the page loaded.<\/p>\n\n\n\n<p>The only problem with that is that when the page loaded it just displayed a div with &#8216;loading&#8217; then replaced that with the images when a script pulled that in. This appeared in the RSS feed too.<\/p>\n\n\n\n<p>I thought that it might be better to do this server side so the images would show in an RSS feed.<\/p>\n\n\n\n<p>This worked out ok once I had remembered lines need to end in semi-colons in php. It was still very basic so I ran it past Claude.ai and asked for security and caching advice. It made a couple of suggestions which I read up a little about and implemented.<\/p>\n\n\n\n<p>I&#8217;ve tried using AI for a few code ideas and I am beginning to see what does and doesn&#8217;t work. What doesn&#8217;t work for me is to ask it to build a whole idea. This has nearly always ended up in problems which seem to loop around. What does work is to ask for somethings specific. In this case I uploaded the plugin to Claude and asked it to find any security problems. It did and suggested some fixes. I am sure that these are simple things that any WordPress developer would carry out without thinking about.<\/p>\n\n\n\n<p>I&#8217;ve also found getting basic information around a function works well with AI. For example Claude suggested using the transient to cache the data from the API. Asking ChatGPT to explain transient gave me a quick handle on the function. (I am sure Claude would have explained too).<\/p>\n\n\n\n<p>Anyway I have made some progress.<\/p>\n\n\n\n<p>This was a good day:<\/p>\n\n\n<div id=\"inaturalist\"><a href=\"https:\/\/www.inaturalist.org\/observations\/232886651\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" src=\"https:\/\/inaturalist-open-data.s3.amazonaws.com\/photos\/413811278\/small.jpeg\" alt=\"Meadow Brown\" title=\"Meadow Brown\" loading=\"lazy\"><\/a><a href=\"https:\/\/www.inaturalist.org\/observations\/232886408\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" src=\"https:\/\/inaturalist-open-data.s3.amazonaws.com\/photos\/413810750\/small.jpeg\" alt=\"Bumble Bees\" title=\"Bumble Bees\" loading=\"lazy\"><\/a><a href=\"https:\/\/www.inaturalist.org\/observations\/232886402\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" src=\"https:\/\/inaturalist-open-data.s3.amazonaws.com\/photos\/413810725\/small.jpeg\" alt=\"Robin\" title=\"Robin\" loading=\"lazy\"><\/a><a href=\"https:\/\/www.inaturalist.org\/observations\/232886400\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" src=\"https:\/\/inaturalist-open-data.s3.amazonaws.com\/photos\/413810717\/small.jpeg\" alt=\"Grey Heron\" title=\"Grey Heron\" loading=\"lazy\"><\/a><a href=\"https:\/\/www.inaturalist.org\/observations\/232886399\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" src=\"https:\/\/inaturalist-open-data.s3.amazonaws.com\/photos\/413810702\/small.jpeg\" alt=\"Osprey\" title=\"Osprey\" loading=\"lazy\"><\/a><a href=\"https:\/\/www.inaturalist.org\/observations\/232886395\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" src=\"https:\/\/inaturalist-open-data.s3.amazonaws.com\/photos\/413810677\/small.jpeg\" alt=\"Meadow Brown\" title=\"Meadow Brown\" loading=\"lazy\"><\/a><a href=\"https:\/\/www.inaturalist.org\/observations\/232846647\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" src=\"https:\/\/inaturalist-open-data.s3.amazonaws.com\/photos\/413734631\/small.jpeg\" alt=\"Little Egret\" title=\"Little Egret\" loading=\"lazy\"><\/a><\/div>\n\n\n\n<p>The above produced with this shortcode:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&#091;&#091;inaturalist user=\"troutcolor\"  on=\"2024-07-30\"]]\n<\/code><\/pre>\n\n\n\n<p>I&#8217;d now like to add some more ideas: names looking a little prettier than the description tooltip, maybe a lightbox view with more information and a link to iNaturalist. But I am not in any rush.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;ve been playing a little with WordPress yesterday. A while back I made the very simplest plugin to display my latest iNaturalist submissions. iNaturalist has a API so I made a short code that would then use JavaScript to pull in the pictures once the page loaded. The only problem with that is that when [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":20970,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"mf2_syndication":[],"advanced_seo_description":"","jetpack_seo_html_title":"","jetpack_seo_noindex":false,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"webmentions_disabled_pings":false,"webmentions_disabled":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[953],"tags":[957,1765,11],"post_format":[],"class_list":{"0":"post-20962","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-posse","8":"tag-ai","9":"tag-inaturalist","10":"tag-wordpress","11":"kind-article","13":"h-entry","14":"hentry"},"better_featured_image":{"id":20970,"alt_text":"A screenshot of the result of the inaturalist plugin, a grid of images. Overlaid with shortcode and snippet of php","caption":"","description":"","media_type":"image","media_details":{"width":1195,"height":1168,"file":"2025\/07\/inat.jpg","filesize":234533,"sizes":{"medium":{"file":"inat-620x606.jpg","width":620,"height":606,"mime-type":"image\/jpeg","filesize":68974,"source_url":"https:\/\/johnjohnston.info\/blog\/wp-content\/uploads\/2025\/07\/inat-620x606.jpg"},"large":{"file":"inat-1024x1001.jpg","width":1024,"height":1001,"mime-type":"image\/jpeg","filesize":139682,"source_url":"https:\/\/johnjohnston.info\/blog\/wp-content\/uploads\/2025\/07\/inat-1024x1001.jpg"},"thumbnail":{"file":"inat-150x150.jpg","width":150,"height":150,"mime-type":"image\/jpeg","filesize":7805,"source_url":"https:\/\/johnjohnston.info\/blog\/wp-content\/uploads\/2025\/07\/inat-150x150.jpg"},"medium_large":{"file":"inat-768x751.jpg","width":768,"height":751,"mime-type":"image\/jpeg","filesize":92611,"source_url":"https:\/\/johnjohnston.info\/blog\/wp-content\/uploads\/2025\/07\/inat-768x751.jpg"},"post-thumbnail":{"file":"inat-668x653.jpg","width":668,"height":653,"mime-type":"image\/jpeg","filesize":75476,"source_url":"https:\/\/johnjohnston.info\/blog\/wp-content\/uploads\/2025\/07\/inat-668x653.jpg"},"sempress-image-post":{"file":"inat-668x653.jpg","width":668,"height":653,"mime-type":"image\/jpeg","filesize":75476,"source_url":"https:\/\/johnjohnston.info\/blog\/wp-content\/uploads\/2025\/07\/inat-668x653.jpg"},"jetpack-portfolio-admin-thumb":{"file":"inat-50x50.jpg","width":50,"height":50,"mime-type":"image\/jpeg","filesize":1775,"source_url":"https:\/\/johnjohnston.info\/blog\/wp-content\/uploads\/2025\/07\/inat-50x50.jpg"}},"image_meta":{"aperture":"0","credit":"","camera":"","caption":"","created_timestamp":"0","copyright":"","focal_length":"0","iso":"0","shutter_speed":"0","title":"","orientation":"0","keywords":[]}},"post":20962,"source_url":"https:\/\/johnjohnston.info\/blog\/wp-content\/uploads\/2025\/07\/inat.jpg"},"jetpack_featured_media_url":"https:\/\/johnjohnston.info\/blog\/wp-content\/uploads\/2025\/07\/inat.jpg","jetpack_shortlink":"https:\/\/wp.me\/p57zFQ-5s6","jetpack_likes_enabled":false,"jetpack_sharing_enabled":true,"kind":false,"_links":{"self":[{"href":"https:\/\/johnjohnston.info\/blog\/wp-json\/wp\/v2\/posts\/20962","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/johnjohnston.info\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/johnjohnston.info\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/johnjohnston.info\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/johnjohnston.info\/blog\/wp-json\/wp\/v2\/comments?post=20962"}],"version-history":[{"count":8,"href":"https:\/\/johnjohnston.info\/blog\/wp-json\/wp\/v2\/posts\/20962\/revisions"}],"predecessor-version":[{"id":20975,"href":"https:\/\/johnjohnston.info\/blog\/wp-json\/wp\/v2\/posts\/20962\/revisions\/20975"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/johnjohnston.info\/blog\/wp-json\/wp\/v2\/media\/20970"}],"wp:attachment":[{"href":"https:\/\/johnjohnston.info\/blog\/wp-json\/wp\/v2\/media?parent=20962"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/johnjohnston.info\/blog\/wp-json\/wp\/v2\/categories?post=20962"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/johnjohnston.info\/blog\/wp-json\/wp\/v2\/tags?post=20962"},{"taxonomy":"post_format","embeddable":true,"href":"https:\/\/johnjohnston.info\/blog\/wp-json\/wp\/v2\/post_format?post=20962"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}