How to download Sony Lifelog Sleep data? - google-fit

Now that the Sony LifeLog API is shut down, I'm trying to figure out how to get access to my sleep data (e.g. daily hours slept, wake up time, bedtime).
In the OAuth playground, I tried sending queries to Google Fit for Sony Data, but I'm getting back an empty point array no matter what I try.
https://www.googleapis.com/fitness/v1/users/me/dataSources/raw:com.google.activity.segment:com.sonymobile.hostapp.everest:Sony Mobile Communications Inc.:SWR12:24234b96:/datasets/1397513334728708316-1504711909728708316
(This date range should be from April 14, 2014 until today.)
I tried with the other datasources I found, raw:com.google.heart_rate.bpm:com.sonymobile.hostapp.everest:Sony Mobile Communications Inc.:SWR12:24234b96: or raw:com.google.step_count.delta:com.sonymobile.hostapp.everest:Sony Mobile Communications Inc.:SWR12:24234b96:, but those both returned empty data as well.
Even though these sonymobile datasources are return from https://developers.google.com/fit/rest/v1/reference/users/dataSources/list, when I query them directly I get a 404:
https://www.googleapis.com/fitness/v1/users/me/dataSources/raw:com.google.activity.segment:com.sonymobile.hostapp.everest:Sony Mobile Communications Inc.:SWR12:24234b96:
(I can see other dataSources are valid though by requesting e.g. https://www.googleapis.com/fitness/v1/users/me/dataSources/derived:com.google.step_count.delta:com.google.android.gms:estimated_steps)
How can I get download my sleep data for the last year?

Related

How to understand Google Cloud Datastream UNSUPPORTED_EVENTS_DISCARDED

Is there a way to get more detail about unsupported events in google cloud datastream?
I am running a datastream from MySQL and have a few UNSUPPORTED_EVENTS_DISCARDED and I would like to understand what these events are.
In the logs explorer detail is limited to something like following:
message: "Discarded 1 unsupported events with reason code: MYSQL_UNKNOWN_ERROR. Latest discarded event details: An unexpected error occurred while fetching log: mysql-bin.013919, log_pos: 91832523."
event_code: "UNSUPPORTED_EVENTS_DISCARDED"
Here are some limitations regarding datastream/mysql:
Events have a size limitation of 3 MB
Tables that have more than 100 million rows
Not all changes to the source schema can be detected automatically
I suspect that some of the data that you are fetching hits the limitation and returns the error. I recommend to review the document with the limitation and make sure all the data can be fetched.

Got blocked by Google Finance

I was trying to write come code for stock market predictions and everything was working fine until it suddenly stopped working and threw an error:
----> 1 get_price_data({'q': 'GOOG', 'i': 86400, 'x': 'NASDAQ', 'p': '1Y'})
/usr/local/lib/python3.6/dist-packages/googlefinance/client.py in get_price_data(query)
12 for price in lines:
13 cols = price.split(",")
---> 14 if cols[0][0] == 'a':
15 basetime = int(cols[0][1:])
16 index.append(datetime.fromtimestamp(basetime))
IndexError: string index out of range
I went to http://finance.google.com/finance/info?client=ig&q=NASDAQ:GOOG
and it said there " We're sorry... but your computer or network may be sending automated queries. To protect our users, we can't process your request right now." ............
So i googled it and on the help page it said "
If you see a message that says "We're sorry, but your computer or network may be sending automated queries. To protect our users, we can't process your request right now.":
Open this reCAPTCHA page.
If you see a normal CAPTCHA (letters or numbers) your computer and network are safe. The site you came from could have a configuration problem. Try to let them know about it.
If you still see the "We're sorry, but your computer..." message, then there may be something wrong. See the tips at our unusual traffic help page.
"
but clicking on "this reCAPTCHA" sends me to as error page "Not Found Error 404"
What do I do?
I tried asking on the Google forum, and immediately got a bunch of hacker responses asking to install remote desktop control :\ ...

URL monitor issue - Dynatrace 6.1

I have created a URL monitor to check the availability of website.I kept all values as it is in monitor tab and added host( http://abcd.xyz.org ). I scheduled it for every 10 minutes in schedule tab. In Measure tab I put the Lower sever value of HostReachable measure to 0.
I created incident , added HostReachable measure and put its Aggregation to last value. Evaluation time frame is 1 minutes.In Action tab I put my email for notification.
Now after every 10 minutes I started getting email even I browsed the website and it's working fine. Couldn't understand if website loading fine then why incidents occurs.
Email message:
Violations
HostReachable: STG URL Monitor#abcd.xyz.org: Was 0.00 but should be higher than 0.00.
Latest logs given below:
2016-08-17 15:42:33 INFO [UrlMonitor#STG URL Monitor_0] Previous message was repeated 1 times.
2016-08-17 15:42:33 INFO [UrlMonitor#STG URL Monitor_0] Executing method: GET, URI: http://abcd.xyz.org:80/
Thanks
This could have to do with the evaluation timeframe of your Incident. If your monitor is scheduled to run every 10 minutes but your evaluation timeframe is 1 minute it means that you have 9 evaluations where there is "no data".
We typically recommend to align the monitor execution with the Incident. Can you give that a try?
Also - I typically chart these measures to see which values the monitor produces in which timeinterval. this is an easy visual verification check to make sure that e.g: the monitor works correctly and delivers data. Can you do that?
I also wanted to say that we have a very good Dynatrace Online Community and Discussion forum # http://answers.dynatrace.com. You might want to try to post future questions there as there are 100k+ Dynatrace users active on that community
Andi

Has anyone reversed engineered the protocol used by Apple's iOS Remote app for controlling an Apple TV over IP?

I'm curious if it's possible for me to write programs that can control an Apple TV, specifically an Apple TV 4th gen running tvOS 9.1.1, like Apple's Remote app for iOS can. I'd like to send it commands for navigating in the four cardinal directions, selecting an item on the screen, going up the navigation stack -- essentially what Apple's Remote app can do.
Has anyone done any work reverse engineering the protocol it uses? Cursory Googling only has so far yielded out of date results about earlier generation Apple TVs and the DAAP protocol which looks like something different than what I want.
I captured the traffic on my iPhone using tcpdump and analyzed it with WireShark. The Remote app asks the Apple TV with normal HTTP requests on port 3689.
The workflow of the app consists in four HTTP requests:
/server-info for getting infos about the Apple TV. It responds with a Apple proprietary DAAP response (Digital Audio Access Protocol) providing some tags about the device, like the display name.
/login is performed during connection, when the app displays the "Connecting to Apple TV..." message. It responds with a DAAP about the login status.
Here's the bottleneck. /home-share-verify validates the connection between the app and the Apple TV. This call needs a Client-DAAP-Validation header with a long unknown string value. According to Wikipedia, this seems to be like an hash generated by a certificate exchange between verified sources that was introduced in iTunes 7.0+ and never reverse engineered.
/ctrl-int/1/{controlpromptupdate|controlpromptentry|playstatusupdate} seems to be the calls made for the input buttons.
Some other minor calls are fired in between (like a Bonjour service update or a /databases call).
Here and here you can find more infos. Hope this helps for getting an overview of how this simple (but protected) app works.
i wanted to tell alexa to trigger appletv and that would wake my appletv up and via HDMI & CEC turn my tv on,
in order to do that:
from your mac\linux\windows simply run:
curl -XPOST -d 'cmcc\x00\x00\x00\x01\x30cmbe\x00\x00\x00\x04menu' 'http://10.1.1.56:3689/ctrl-int/1/controlpromptentry?prompt-id=144&session-id=1'
the abstract command is:
curl -XPOST -d 'cmcc\x00\x00\x00\x01\x30cmbe\x00\x00\x00\x04menu' 'http://{APPLETV_IP}:3689/ctrl-int/1/controlpromptentry?prompt-id={CONTROL_PAIR_ID}&session-id={CONTROL_SESSION_ID}'
i extracted the CONTROL_PAIR_ID and CONTROL_SESSION_ID by setting my iphone wifi http proxy settings to my mac with fiddler on it and activated the old appletv remote app and that displayed the requests the app is executing
if you don't know how to set iphone to work with fiddler you can find it here:
http://docs.telerik.com/fiddler/Configure-Fiddler/Tasks/ConfigureForiOS
I did manage to control my Apple TV (currently running tvOS 9.2) from a python script. It turns out that you don't need to use Home Sharing to have a remote app control the Apple TV. I don't know if the following method will work if Home Sharing is enabled, but with it disabled on the Apple TV, the iOS Remote app has the option to manually add a device. (This may require removing all of the devices it is already paired with, since that was unfortunately necessary for me to get it to display the 'Add a device' button.) Once I had paired my iPhone to the Apple TV, I recorded some of its requests, copied the pairing GUID, and then constructed some of my own requests.
The only three requests necessary to make are:
/login?pairing-guid=< your pairing guid here >&hasFP=1
Logs into the Apple TV. The last four bytes of the response's is a session id, encoded as a big-endian four byte integer.
/logout?session-id=< your session id here >
Logs out. Not strictly necessary, as I found that logging in simply gets you a new session id, but probably not a bad idea to do things the way it expects.
/ctrl-int/1/controlpromptentry?prompt-id=114&session-id=< your session id here >
Send user input to the Apple TV. The data is one of several buffers that input a command, or possible a moving touch. For movement in the cardinal directions, sending several of these requests to simulate a moving touch is necessary.
I have a python script demonstrating how to do this here:
http://pastebin.com/mDHc353A
Utilizes the requests library: http://docs.python-requests.org/en/master/
Also special thanks to Adam Miskiewicz / github user skevy, since I made use of this file in his atlas-backend repo that conveniently had the right buffers to send for movement: https://github.com/skevy/atlas-backend/blob/master/atlas/services/appletv.coffee
For any people still checking out this question, I recommend checking out pyatv if they want to control their Apple TV through a python or command line interface.

How does google update their google finance graphs?

i'm looking at a stock/index:
http://www.google.com/finance?q=google
I've got firebug open, in firefox and when the price updates on the page, i dont see any GETs or POSTs, just a get maybe 30 to 60 seconds later.
Surely if the page is being updated with a value, wouldnt firebug show this data reaching the page as it happens? Or does firebug collect connections in batches?
Look further back in the GET connection logs to see if there is a connection that was opened but not closed. It's likely that the page is opening an XmlHttpRequest connection to the data server and keeping the connection open indefinitely. This is common for streaming data situations, even when the data stream is fairly low volume. If this is the case, then new data will arrive on the open connection without any new connection activity reported in the log.
There is one request that never finishes responding (or at least not for the time I watched), you can see this in the NET panel, this response periodically outputs more data which is then used to update the application. If you examine the request you will see that it specifies a header Transfer-Encoding: Chunked, which is used for these purposes, see http://en.wikipedia.org/wiki/Chunked_transfer_encoding.