Comments (7)
On Windows 10 you should use -UseBasicParsing
option for Invoke-WebRequest
cmd, so the command will look like this:
powershell ((Invoke-WebRequest -UseBasicParsing -Uri wttr.in/Astana?format=3).Content)
But another problem is that weather emojis and symbols are not recognized properly in Obsidian:
from templater.
Hello @yeders, sorry for the last answer.
I updated the README to include the -UseBasicParsing
option as suggested by @unstppbl.
So in your case, this would give powershell ((Invoke-WebRequest -UseBasicParsing -Uri wttr.in/Campsie?format=3).Content)
Could tell me if this command works for you ?
The emojis are another problem that comes from powershell.
from templater.
@SilentVoid13 I can confirm it doesn't work on windows 10. This isn't just in Obsidian either, it's within PowerShell. However, copying the broken text from PowerShell into Obsidian will make it display correctly. Perhaps this has something to do with how the website is encoding the text?
from templater.
Using windows newer terminal supports the emoji's and other features
I do find it odd that Templater when copying the output and once inside of Obsidian it doesn't display correctly but doing it manually does.
from templater.
My curl command in Win10 is working.
Working:
curl "wttr.in/Campsie?format=%l:+%C+%t+%p+%w+%h"
Not working:
powershell ((Invoke-WebRequest -UseBasicParsing -Uri wttr.in/Campsie?format=3).Content)
from templater.
Got a solution for this:
Follow these steps:
Make UTF8 the global default
Templater Template weather
powershell -command "& { (Invoke-WebRequest -Uri 'wttr.in/NewYork?format=3').Content }"
Trigger with <% tp.user.weather() %>
Result
from templater.
As @luckman212 said, unicode chars problems are not coming from Templater, but from cmd.exe and powershell.
I added some documentation on solutions to fix this problem: https://silentvoid13.github.io/Templater/docs/faq#unicode-characters-emojis--are-not-working-on-windows-
Closing this.
from templater.
Related Issues (20)
- Folder template (checkbox - include subfolders)
- Create new file from template HOT 2
- tp.date.now returns incorrect time. HOT 2
- Add native AI support HOT 2
- Add `<%*` tag to documentation HOT 1
- Templater script inserting newline before front matter HOT 3
- Don't Include Frontmatter in Output HOT 2
- Folder Notes take priority when creating file HOT 7
- Expand metadata in space - Geolocation coords support request
- Console error: app.js:1 No file creator assigned to create file with extension com. Falling back to markdown file creator. HOT 1
- Error: Failed to List Templates, No Template Folder Configured HOT 8
- Execution of the tp.file.selection() function erase the selection in the note HOT 2
- Add note about modified date to the FAQs / docs
- front matter formating number as a string HOT 1
- main.js missing HOT 3
- Date not rendered as link HOT 1
- 2.3.2 broke my frontmatter processing template HOT 5
- Auto jump to cursor is triggered twice on new file creation HOT 4
- invalid reference date format, try specifying one with reference format HOT 4
- bug: app.workspace.getLeaf().openFile() replaces content in a note if called without "await"
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from templater.