gData+Python Calendar API - Doesn't update? - python

I'm trying to write a python script that I can crontab to pull about a week's worth of google calendar appointments, and take any with a Hangout attached and add the link into some visible area where OSX iCal can pick it up.
My project is on github at https://github.com/Yeraze/CalendarHangout
Right now it appears to work. It finds about 20 entries on my calendar, properly pulls the link and updates them, and then submits a batch update of 20 items back to google. However, I'm seeing some weirdness that I can't debug:
1) Several of the events have disappeared from the GCal website. They still show on all my i-devices and OSX Calendar (even after multiple forced refreshes), but they've disappeared from the website.
2) Every time I run the script, it still says these items need to be updated, like nothing's actually updating.
Can someone with some more experience on this help? What am I missing?
Update Seems they've been converted into something like the Weather icons.. I see them as little boxes at the top, right under all-day events.

I'm closing this... Seems this isn't really supported in V2 of the API. I've upgraded to V3, found similar glitches, and opened a new question .
https://stackoverflow.com/questions/20321632/gdata-api-v3-calendar-hangouts-urls-and-attachments

Related

Amazon Sagemaker Runs doesn't show any run with the new update

So I think the Sagemaker UI was updated very recently this week, and now I can't find any of my previous "runs" / "trials" / "jobs"...
When I go to home - Experiments, I can see the names of two experiments I have done in the past, but when I click on it, it just says "No runs / You don't have any runs". Not only did I have a bunch of runs / jobs (not sure if the term changed), but when I try to launch another one with my previously working script, it runs well (and saves itself well on S3) but doesn't show.
Anyone has the same problem ? Where should I turn to help ?
As part of those changes, automatically generated runs (previously called "trial components") are hidden by default.
On the "Runs" table for your experiment, click the cog icon in the upper right and enable "Show jobs". This will display any automatically generated runs in the table.

How to click on a video using Selenium

I'm new to coding using python and it's libraries, and also new to stackoverflow so I apologize if I'm not acquainted to some things.
Anyway to the question. I'm trying to write code that automates playing a video from the website that. Here's an example link:
http://www.shush.se/index.php?id=164&show=southpark
I've tried these methods:
driver.find_element_by_id("playerload").click()
driver.find_elements_by_xpath("./html/body/table/tbody/tr/td/div[#id='load']/div[#class='player']/div[#id='playerload']/div[1]")
But nothing happens. The program exits without error but the video does not
start playing.
I tried clicking a the id "jw6playerid5040619_wrapper" but the number associated with that changes every time a page loads.
Any advice? Thanks in advance!
Even though you don't know the exact id, you know that it will start with "jw6playerid". The following works for me:
elements = driver.find_elements_by_xpath("//*[contains(#id, 'jw6playerid')]")
elements[0].click()

Any possible way to save webpage state to HDD?

Essentially what I want to do is be able to click a button and have the webpage state be stored somewhere on the HDD so it doesn't need to just sit in RAM, and when it's loaded again at some later time the page pops up exactly as it was before as if it had never been closed without the need to download anything over the internet to restore it (although additional resource requests that didn't exist when the page was saved should still download properly).
(as an example, firefox does this when it crashes, all the tabs are restored, text you've typed is still in the textboxes, etc..)
I don't care if that button is in a firefox plugin, chrome, or even a custom browser that I program myself with something like webkit perhaps.
I've been trying for days to find a way to do this. I made WebKit programs in both C++ and Python but every time I think I'm getting close there is some deficiency in webkit or a build-in security measure that prevents me from doing this. I tried creating MHTML archives but they don't allow javascript to download new data over the internet, I tried pickling the entire WebKit.WebView object in python, I tried looking through webkit code to see if I could patch the behavior into the source code myself
I'm running out of ideas and the only one I see left is to just post this online. Is there any way that I can do this, in any programming or scripting language, using any libraries at all?
I just have no idea where to turn next.

How can I program a macro that will do the clicking for me in a web game?

I'm currently playing Mr. Mine and I'm lazy to click 'sell' every 1~2 minutes.
I could use a mouse macro program that I can make the computer to do the clicking for me but this sounds like an inelegant method.
I was thinking about some way I could make a code that will hack into the web browser with the web game on and somehow send some kind of 'request' to the server that will sell the minerals.
I mean, after all, clicking it by hand eventually will send some request to the server so why not do this sending through a preprogrammed code?
I know my question is broad, so let me ask a few questions that will give me a lead to start on my project.
What to I need to learn to understand the 'sending request' part?
Is there anyone or any script that has already done what I want to do?
I'd like to take a look at the source code. (it's okay even if its not Mr.Mine. any other web game would also be of help)
Also, I'm currently interested in python so if there's any example in python, I'd be really thankful.
update: "I've solved the problem"
I'm just writing how I solved the problem just in case some other folk who just started Mr.Mine faces the same laziness that I did.
As it turns out, Mr.Mine doesn't actually exchange packets with its server. It only uses internet connection for initial loading of images and all that.(I think it is..)
If you right click on the Mr.Mine web page and view the html code of it, you'll find that its full of javascripts.
After roughly reading through these javascripts, my theory that this game doesn't rely much on packet data became more persuasive.
Anyway that's why I approached my problem at a javascript perspective and I finally got a solution
What you need to do is utilize chrome's developer tools.(I'm a chrome user)
You can access to this tool also simply by: from the mr.mine web page, right click anywhere -> click the very last button. Then you'll see some panel popping up at the bottom of the screen.
this tool enables you to fiddle with the html code or javascript in it.
I'm not good at this either since this is my first time actually using it for a practical purpose.
I just managed to scrape enough knowledge about this by googling to satisfy my needs.
In this new panel, at the top menubar, there's the 'Console' tab on the very right.
Click this and you'll see a command console.
This is where you can execute java commands within the javascript of the webpage.
Well from here, its strictly 'Mr.Mine' related.
From my previous rough reading of the javascript, I found that the sell buttons have been given the ID such as 'SB2', 'SB3', 'SB4', and so on.
So what I did was just type
setInterval(document.getElementById("SB2").onclick, 300);
at the command line and pressed enter.
this command will automatically press the SB2 button(which corresponds to 'Coal') every 0.3 seconds.
*Caution: you must have the 'selling' page opened when this code is executed. I found out that if the 'sell' page is not opened, the code doesn't work.
*Caution2: another funny thing is, even within the 'sell' page, if you transfer to the 'sell isotope' page, it will automatically sell Uranium 238. That's because the SB2 button corresponds to Uranium 238 in 'sell isotope' tab. So be careful!
*Caution3: if you do this, an error popup will constantly come up. I just enabled the 'never show this popup' checkbox and after that it just worked fine. But one side effect: the usual popup that came up after pressing the 'save' button no longer appeared... but its worth the sacrifice isn't it?
anyway, if you want to automatically sell other ores, all you have to do is type similar codes like:
setInterval(document.getElementById("SB3").onclick, 300);
setInterval(document.getElementById("SB4").onclick, 300);
... etc.
see that just changing the number after "SB" corresponds to the next ore(isotope) in the list.
Well, thanks for reading this much, and I hope other Mr.Mine users can be creative and do more through this technique.
You could use a packet capturing tool such as wireshark. With that figure out the format and data that the game sends to the server.
Once your know the structure you could write your script to intercept your game traffic, add the needed parameters and send requests on a timed basis. (This is all assuming it does encrypt its network traffic, in which case this may be a bit more difficult)
You may find some additional information with this search.
perhaps you can use http://www.sikuli.org/. i have successfully used this to do a fairly complicated automation routine for eve online.

Windows Balloon-tooltips in Python

Following the example at http://article.gmane.org/gmane.comp.python.general/541418, I've succeeded in creating a callable class for balloon tooltips, but the greater complexities of that code elude me when it comes to customization. I browsed a bit of how it works through msdn, but being a novice at more windows-esque languagues like c and vb, etc. I was unable to make much sense of it.
So I ask ye snakely academics:
Things I'd like to be able to do with that code aside from the standard icon, title, text:
Perform actions based on clicking the tooltip
Modify the tooltip that pops up over the icon in the system tray after loading it (to reflect changing values)
Multiple lines? (Not sure if this can even be done, really)
More information on other things you could do in a windows 7 environment versus XP (which seems to be what this was written for).
Ideally I'd get some sort of return value or some semblance of an event when the tooltip is clicked so that I could run some code, but currently I'm importing that code as a module and calling at various times, so I'm not sure how to handle clicks outside of the popup code itself...
Information on handling these things with python seems quite scarce. Thanks in advance.
Perform actions based on clicking the tooltip
Whats the problem OnTaskbarNotify? Hock yourself in there.
Modify the tooltip that pops up over the icon in the system tray after loading it (to reflect changing values)
Probably not, I am not sure about the WinAPI here. I haven't seen it in the wild, so...
Multiple lines? (Not sure if this can even be done, really)
With most WinAPI, just insert a \n in the string.
More information on other things you could do in a windows 7 environment versus XP (which seems to be what this was written for).
LOTS... But that is a bit vague... It depends what your needs are. But for kol feturez you need to google on your own...
On Linux and Unix systems I use the notify-send OS already implemented system.
import os
os.system('notify-send "'+title+'" "'+message+'")
Maybe in Windows there is some API32 for this.
Check this https://gist.github.com/wontoncc/1808234

Categories