Weather-App and Widget Connection Problem

Meecast also has the option to replace lockscreen widget

1 Like

Where? I can’t find any such setting…
(Version 1.1.35 from the Jolla Store.)

MeeCast for SailfishOS | OpenRepos.net — Community Repository System and search for the other parts, or you can get it all from chum.

3 Likes

There is no built in option for turning off weather icon on lockscreen but you can do it manually by editing one character in this file /usr/lib64/qt5/qml/Sailfish/Weather/WeatherIndicator.qml at line 16 and remove ONE exclamation mark, so the line becomes visible: !weather. Restart lipstick to see the change. systemctl --user restart lipstick

4 Likes

@Edz,
Thank you! This is exactly what I need.
(I plan to use no weather service, not even MeeCast.)

2 Likes

Another option:
open website Wetterkalender | Meteomatics
scroll to “City” >myPlace< use >Generate< and >Copy link<
in sailfish go to >settings>Accounts>Add account>Web calendar
and paste webadress.
If you don´t want to use an app…
i like it

17 Likes

There’s always wttr.in for hardcore cli users (sadly v2 doesn’t render correctly)


10 Likes

thanks for the tip, that’s what I’m using now. Works great!

1 Like

Could someone paste the first 10 lines from the following file please

`/usr/lib64/qt5/qml/Sailfish/Weather/ForecaToken.js`

Thanks,

nice try^^ is this serious?

For those of us who have typed dd in vi quickly followed by :wq this is a most serious thing indeed :slight_smile:

1 Like

okay here is the whole file with my credentials: .import Sailfish.Weather 1.0 as Weather
.pragma library

var user = “s-ebastianmatkovich”
var password = “RjvRUJlWj2AE”
var token = “eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOlwvXC9wZmEuZm9yZWNhLmNvbVwvYXV0aG9yaXplXC90b2tlbiIsImlhdCI6MTcwMDAzMTIxNSwiZXhwIjo5OTk5OTk5OTk5LCJuYmYiOjE3MDAwMzEyMTUsImp0aSI6IjhhMzAwYjJlZmUyYzhjOGMiLCJzdWIiOiJzLWViYXN0aWFubWF0a292aWNoIiwiZm10IjoiWERjT2hqQzQwK0FMamxZVHRqYk9pQT09In0.WlbbqSu5m3kaCW1vW-FapgxVJ__lsiavND_pbXwMU20”
var tokenRequest
var pendingTokenRequests = []
var lastUpdate = new Date()

function fetchToken(model) {
if (model == undefined) {
console.warn(“Token requested for undefined or null model”)
return false
}

if (token.length > 0 && !updateAllowed()) {
    model.token = token
    return true
} else {
    if (!tokenRequest) {

        if (user.length === 0 || password.length === 0) {
            var keyProvider = Qt.createQmlObject(
                        "import com.jolla.settings.accounts 1.0; StoredKeyProvider {}",
                        model, "StoreKeyProvider")

            user = keyProvider.storedKey("foreca", "", "user")
            password = keyProvider.storedKey("foreca", "", "password")
            keyProvider.destroy()

            if (user.length === 0 || password.length === 0) {
                console.warn("Unable to get Foreca credentials needed to identify with the service")
                return false
            }
        }

        tokenRequest = new XMLHttpRequest()

        var url = "https://pfa.foreca.com/authorize/token?user=" + user + "&password=" + password

        // Send the proper header information along with the tokenRequest
        tokenRequest.onreadystatechange = function() { // Call a function when the state changes.
            if (tokenRequest.readyState == XMLHttpRequest.DONE) {
                if (tokenRequest.status == 200) {
                    var json = JSON.parse(tokenRequest.responseText)
                    token = json["access_token"]
                } else {
                    token = ""
                    console.log("Failed to obtain Foreca token. HTTP error code: " + tokenRequest.status)
                }

                for (var i = 0; i < pendingTokenRequests.length; i++) {
                    pendingTokenRequests[i].token = token
                    if (tokenRequest.status !== 200) {
                        pendingTokenRequests[i].status = (tokenRequest.status === 401) ? Weather.Weather.Unauthorized : Weather.Weather.Error
                    }
                }
                pendingTokenRequests = []
                tokenRequest = undefined
            }
        }
        tokenRequest.open("GET", url)
        tokenRequest.send()
    }
    pendingTokenRequests[pendingTokenRequests.length] = model
}
return false

}

function updateAllowed(interval) {
// only update token if older than 45 minutes
interval = interval === undefined ? 45601000 : interval
var now = new Date()
var updateAllowed = now.getDate() != lastUpdate.getDate() || (now - interval > lastUpdate)
if (updateAllowed) {
lastUpdate = now
}
return updateAllowed
}

Um. No personal information please. Let’s keep it to knicknames and avatars :slight_smile:

1 Like

in less than 1 month the personal information is useless anyway

Real hackers can grep foreca /usr/share/libsailfishkeyprovider/storedkeys.ini as root (or from a privileged shell), write a little program (or a script) that xor’s your foreca username and password with the provided key and then update that file :slightly_smiling_face: This way, you won’t have to modify any .js files. You probably have to restart lipstick after updating storedkeys.ini to make sure that home screen pulls in your new credentials.

2 Likes

Why in less than a month? Id say its already all for sale ? :wink:

Yeah, I was serious, why the attitude @smatkovi?, you did not have to include your API key, which is no fkin good to me or anyone else anyway. Wow, attitude with some people here {{{smh}}}.

Basically, although it’s a rooky mistake, I edited the said file without making a back up. I had edited my user/pass/key and the next few lines after, which is why I asked for the first 10 lines, not the whole file or your api key/username/password. Next time I need such information, I will better define what I’m asking.

Thanks for posting the necessary file, I now have fixed what I’d deleted from ForecaToken.js

@slava, thanks for details. I’m not trying or wanting to hack anyone. I’m not a hacker and would not even call myself a coder/programmer despite making dozens of my own apps for my device.

Although the wiki python version, XOR cipher - Wikipedia, will do, I think @slava may have a more interesting solution in c :slight_smile:

It’s hard to believe Jolla would leave the weather app broken for three months. It can only be a lack of money, surely? Did Foreca up their license fee so dramatically Jolla couldn’t afford it? Or is Jolla’s financial situation so dire they’re cutting any and every cost. It’s disappointing.

2 Likes

They are in legal restructuring process, see
https://forum.sailfishos.org/t/re-organisation-of-jolla-company/17133/17?u=davidrasch
This might limit their ability to spend any money.

4 Likes