pull down to refresh

Web-Screenshot-PluginWeb-Screenshot-Plugin

A Web Screenshot plugin for OpenAgents.

Github Repository: https://github.com/nkn18/Web-Screenshot-Plugin

LN Address: kemang1_wangi@stacker.news

IntroductionIntroduction

This Web Screenshot Plugin utilize Restpack Screenshot API that can capture screenshots of live web pages and deliver the results in JSON Format.

API Documentation.

BuildBuild

Include the library with Go get:

go get github.com/extism/go-pdk

You can find the reference documentation for this library on pkg.go.dev.

UsageUsage

Run the plugin using this command :

extism call plugin.wasm run --wasi --allow-host="restpack.io" --input="WEB_URL"

Note : "WEB_URL" - The URL of web page, including the protocol that you want to capture.

Usage Example & Screenshot ResultUsage Example & Screenshot Result

https://github.com/nkn18/Web-Screenshot-Plugin/assets/57341598/641bac82-e5a9-45ab-9cbc-7c217b048467 https://github.com/nkn18/Web-Screenshot-Plugin/assets/57341598/fcf2adc3-ccef-435a-9352-142a237af4b4 https://github.com/nkn18/Web-Screenshot-Plugin/assets/57341598/d7a1184c-09c8-47e8-b486-595a464ff5fe

this territory is moderated

@AtlantisPleb I've done some changes to the code :

JSON Response Handling:

  • The JSON response from the API is decoded to extract the "image" URL field.

Error Handling:

  • Added error handling to manage JSON decoding errors and invalid/missing "image" field in the response.

JSON Encoding:

  • The extracted "image" URL is re-encoded into a JSON object to ensure it can be handled efficiently.

Memory Allocation and Offset Management:

  • The JSON-encoded image URL is allocated in memory.
  • The memory offset where the URL is stored is then passed back as the output.

With these changes, the functionality now correctly fetches only the image URL from the API response, handles errors, and manages memory allocation to ensure seamless processing and output.

reply

Awesome! Thank you!

reply

This will open up some cool possibilities when combined with agents and other plugins.

reply

I agree, thats why i build this plugin in the first place

reply

Amazing! Will review shortly

reply

Thanks! i already DM on X

reply

IT WORKS! Great job, happy to award a bounty for this

I don't see a DM from you, can you try again @openagentsinc

https://m.stacker.news/31111

reply

Hey Thanks! Re-sent the DM or this is my twitter https://twitter.com/kemang1_wangi

reply

hi, any updates regarding the review process?

reply

Yep will do later today

reply