Widget Examples

The code is not adaptive ,it needs to updates…

Hi Mzeryck,

I tried to modify this version to add reminders.
But I now understand that I’m really bad at this.
Could you extend this code for reminders?
Would truely be amazing <3

Thanks in advance!

1 Like

Agree, please lock this thread.

Perhaps add links to the related new threads to route follow on questions appropriately.

1 Like

I just created a widget that shows the current count of followers for an instagram account.
If you are interested, have a look for the code here:

https://github.com/bestmacfly/Sriptable-Instagram-Follower-Widget

This is how it could look like:

Wow, this thread will never end–here’s my approach: My first widget displays sunrise and sunset at your location.

Inspired by this wonderful app allowing me to code JavaScript for my iPhone, here’s my first approach to calculate the exact times of sunrise and sunset at the iPhone’s location. Have fun with it!

Code: https://gist.github.com/HendrikRunte/4b5d03cb26e31508bc96553ad3c10f47

Hope it works for you as it does for me.

5 Likes

Thanks a lot, i played around and adopted it for the City of Hamburg:


D40253C4-84B4-430D-944B-E4D6562EF435_1_201_a

thanks for all your work

1 Like

hi, this is exactly what i was looking for @pdizin or @mzeryck is it possible for you to incorporate the reminder function in the last version of @mzeryck modular widget. it would be a dream if the reminder app would open when you click on the reminder. thank you for your work! unfortunately i have no experience in programming.

Hi supermamon!

Thank you so much for your work on making it possbile to make transparent widgets!

Unfortunately I’m not able to make them using your instructions. Could you maybe help me on getting them to work on my new iPhone 12 Pro? I would love to have a transparent medium widget on the top my first homescreen.

I downloaded your “no-background.js module”, “No Background Config.js Script” and “Widget template” in my Scriptable App but was not able to get them to work. If I try to run “no-background.js module” : nothing happens
“No Background Config.js Script” : Error on line 14:26 No file to import at no-background.js
"“Widget Template” : Error on line 6:26 No file to import at no-background.js

Would be awesome if you could help my figure it out :slight_smile:

Can you add the actual weather to the right side of the header of the calendar widget?

Thanks a lot @akerr :blush:

1 Like

It’s gonna sound silly but try re-downloading no-background.js then run the config again.

Thanks for your reply! I tried it but now I’m getting this error message:

Error on line 225:27 Type error: undefined is not an object (evaluating ‘items’)

Any help on getting it to work? :slight_smile:

Here’s my contribution to the widgetsphere (building upon r/Slowlydev and @marco79): WeatherCal displays 4 compact sections with hourly, daily, sunrise/sunset, and upcoming event data. I tried to organize things effectively to make it easy for others to switch out my modules with whatever works best for them (like the day and date instead of sunrise data).

7 Likes

Hello eqsOne: I tried to scrape data from https://geoportal.essen.de/covid19/ but it won‘t work. I think it is not a classical html site. Do you have a clue how to scrape data from this website?

Hi Simon,

I’ve been using your launcher code, and it works great, but I am having to open files app and download app icons before it works. I have tried to add in fm.downloadFileFromiCloud in multiple places but am unable to get this to work.

Any help would be appreciated!

This is great, thanks so much for sharing. I’m a complete novice, but I got it to work (other than the Sonos feature, which is beyond me). When I tap on the widget, it momentarily opens Scriptable before it passes on to Spotify. Is this Scriptable pop-up avoidable? (Or perhaps I just managed to mess something up.) Thanks!

This one looks great @grantavery! Will try to create something similar. Love the fact that it looks like the shortcuts widget from Apple.

I had the same error and think I figured 2 problems. Feel free to correct me if I am wrong supermamon but I believe those 2 issues are just simple typos. In the no-background.js module line 61 has a period in stead of a comma. Line 61 should read:

“await presentAlert(message,[“OK”],ALERTS_AS_SHEETS)”

The second issue is that line 240 incorrectly identifies the iPhone 12 screen size as 2352, when in fact it is 2532. If you make both the changes it should work.

1 Like

Working on a sunrise/sunset widget:

Unfortunately I can’t get the layout the way I want:

  • 4 (aligned) columns per line (image, hours, colon & minutes)
  • image, hours, colon & minutes vertically centered
  • minutes & hours right-aligned

Any tips on how to achieve this layout?

PS @simonbs: is there a bug in time formatting? Even though I use numeric (not 2-digit) I still get a leading zero in the sunset hour…

@gentlel Nope, sorry. Looks like the required DOM elements are generated dynamically. Here is a snippet that logs what WebView can see:

await loadCnt()

Script.complete()

async function loadCnt() {
  let url='https://geoportal.essen.de/covid19/'
  let wbv = new WebView()
  await wbv.loadURL(url)
  
  //This logs available html stuff:
  let x = await wbv.getHTML(url)
  log(x)
}

@klaus_schuser Well done, great!