Google Chart APIs for plotting data in local machine - scripting

Preface:
I am a system programmer (who has just started his career as a S/W Engineer), so not very good # web scripting languages, though I have just started learning them.
Problem Synopsis:
I want to write an app that keeps track of what I am doing and records it allowing me to analyse my time spending pattern and could help me analyse whenever I want.
Problem Description:
My plan is to write an app that sits in the background and keeps track of active window on my desktop (every second) and stores this data in a SQLite database. But to be more appealing (As I want to share this app with others), I want to have a feature where the user can analyse data recorded between any period of his interest. For this I want the user to be able to generate charts and graphs using the recorded data.
For this I thought of using browser for UI and Google Visualization APIs for plotting work. So, is it possible to use Google Visualization APIs to plot local data? if so, plz guide me on how to continue... (As told before, I am a system programmer, C programmer to be specific, who has just started learning web scripting in free time)
Reasons for these decisions:
(1) App that records what I am doing will be in C/C++ - B'coz I am system programmer and am very comfortable with them. And can get it done easily and quickly.
(2) SQLite - Very small and can easily be embedded in my app, and is Open Source. And I think many web scripting langs like PHP, python have interfaces to access SQLite DB.
(3) Browser for UI - Hope it will be easy for user to use browser, and I will not have much to do regarding UI. As main UI will be browser and Google Visualization APIs will do plotting. All I might have to do is write few lines of script (Am I right here on the last point???)
Comment on my design decision and any tutorials(or pointers) which teaches me on how to do this will be highly appreciated...
Thank You
MicroKernel :)
PS: Idea inspired by Nathan Baulch's reply to https://stackoverflow.com/questions/161590/how-do-you-track-your-time
#Nathan Baulch, Thank you so much for such a brilliant idea. \m/

I would embed browser to app (you want to write in C#)
and use jquery plotting as chart. You will find more info here: http://www.flotcharts.org/

Related

GET, then manipulate that info (while loop and if statements), then PUT

I feel like this is a simple enough thing to do and can't believe how hard of a time I'm having finding the example I need so alas, human help please! You failed me Google :)
FYI I've written a bit of code in my life (Java, C, ASM, PHP), new to APIs.
As the title lays bare, I want to retrieve info (tickets out of our ticketing system meeting certain conditions) via a GET request, loop through each ticket, and update each one (PUT) based on certain conditions.
If there's a tutorial you know of that covers that, please point me to it! If not, if you could please fill in some of these holes?
I wound up in Postman, is this an appropriate environment to accomplish such? Of course you can make individual API calls here but I got lost trying to string the aforementioned sequence together. Is it possible via "Create API?" This makes it sound like I'm creating my own API server for other users to access data from. If it is possible via "Create API," where's the dang run code button?! If not Postman, what tool should I be using to write code in? And again, if you have any code samples/videos closely resembling said scenario for that tool.
Thank you for any assistance you can offer.
Cheers,
Jay
You want to interact with your ticketing system: read existing tickets, and update them. Correct?
To do this, your TICKETING SYSTEM must have an "api" (possibly - but not necessarily - a REST API).
If it does, you might be in luck. But you need to learn the API first, possibly from product documentation. If it doesn't, there's probably not much you can do except to interact with the system as a "normal user".
If it has an API, and if it's a relatively simple API (like REST), you can use the API manually (e.g. through POSTMAN), or you can use it programmatically (using Python, C#, Java or just about any programming language you feel comfortable with).
In summary, you need to:
Determine if your ticketing system provides any kind of web api
If so, get the API details
If at that point you want proceed, determine what programming language or framework you'd like to use.
Hopefully that gives you a bit of "direction".

Program that can extract something from a website

I`m sorry if this is the not right place to ask. If not please delete this.
I`m looking for someone that can help me with a very simple program that can do this:
Login into accounts on an website and extract there a number from every account and and save the details ( account number - the number that must be saved ) on an txt file.
I need this for my job. This program will save me a`lot of time. this is the purpose.
If anybody can help me please let me know. thank you very much.
Fortunately for you, there is ample tooling available.
I will provide you some insight into related tools in the Python ecosystem, since that is what I am most familiar with and also an easy languages for beginners to work with.
If what you are extracting/scraping is relatively simple and doesn't require complex UI interaction with website elements, I would recommend requests Sessions to retain cookies and additional information for use in a series of authenticated requests, and bs4 to parse document trees in order to extract the data you are interested in.
For more complex interaction, you will need to look towards browser automation and possibly more advanced scraping frameworks. Hopefully I've given you enough keywords to go far in Google.
Of course, you'll need to first learn the basics of programming and how web data is structured if you want to write scripts like this. That is left to you to learn and absorb.

A Conceptual Understanding of APIs

I have been learning coding for about a month now. I have some good experience with Python, and additionally I have completed this web development course on Udacity.
Now, I have a good foundation for programming, but one thing that confused me a lot is how to interact with various websites and APIs. The course I did briefly touched on this in terms of XML and JSON files and how some webpages offer their pages in these formats for easier reading by other machines.
But there are still a bunch of tasks which I have no idea how to approach whatsoever, but want to eventually do. I have constructed some hypothetical examples for the purpose of this question. I will post my current rough understanding of how I would do them below each one, and would appreciate feedback (on the API interaction, not on the front-end or on any back-end algorithms/AI/parsing):
Creating a phone application (disregarding the front-end part) which can then communicate with and perform rudimentary tasks on my computer.
I have no idea how to do this, and my guess would be that I would have to look into some external application/API meant for this process and implement this on both-ends of the system.
Being able to write a bot which goes on to a game website and controls the object via script. (e.g going onto a pacman game website written in flash and automatically controlling the character to avoid the ghosts)
I don't even know if this is possible, or how browser flash games interact handle the user-server interaction. Would I have to post some data via HTTP manually in the same way that playing in the keyboard would do? Or is everything done client side, in which case how would I fake user input? How would I get information on the ghost's position to work the AI?
Creating a mobile app for my school by allowing users to put their username and password into the app and then having the app automatically log in to the school and fetch certain data (e.g timetable) and return back in a readable form.
I'm guessing that I would take the input from the user on my mobile-app, and then navigate to the school's login page and POST this data in the relevant forms to log in. And then that I would (somehow, not sure), navigate to the timetable URL through my code while still managing to stay logged in, and then parse the html there?
I would appreciate some detail on how these kind of things are done, preferably with reference to these examples, so that I can get a better conceptual understanding.
Thanks!
Note: I have asked all those various questions mostly rhetorically, just so that those reading can get a better understanding of what my current programming level and understanding of APIs is at. I do not expect nor require specific answers for each and every question (so I hope this doesn't get flagged as being too vague or requiring too much detail!), I just would appreciate some responses telling me roughly how each of these APIs work approximately and how I would even start at looking at how to do these things.
You asked too many questions and honestly speaking I am not able to read and grasp entire text posted by you.
So, I am focusing only the title of your question:
"A conceptual understanding of API"
API (Application Programming Interface) means a set of functions which you can directly use by simply passing parameters to them.
Actually, in application development there are many common functions which every application programmer have to use. So, instead of coding them every time by every programmer, they are already coded in functions which you can use simply by passing parameters to them (if they need any external parameter).
Example:
I am offering you a maths API, set of functions {add, sub, mul, div}. You can pass two numbers to any of these four functions and get desired result instead of coding every time for ever operation like add, sub, mul and div.
Hope it helps...

Google Apps macros - how do they compare to Office VBA macros?

Do any of you use the javascript macro capabilities of Google Apps, particularly for spreadsheets? How do the capabilities compare? Is there anything that Google Apps can't do that can be done with VBA macros?
I am in the middle of conversion of a complex project from VBA to Google Apps Script as an experiment to see what can be done and what can't.
In general, the development environment for google apps script is primitive and frustrating. The language is of course javaScript so if you already know that then you have a head start. The problem though is that many of the advantages of javaScript are not realizable since you don't actually have access to DOM elements, and neither do you have an equivalent of Excel shapes - except through the UI object- which is essentially the same as an excel form, with the same kind of events and objects etc.
Another issue is general slowness. You need to be careful how you structure, so that you minimize calls to the spreadsheet data (I got round this by building a values cache), and scalability is very questionable.
I am equally at home with javaScript or VBA, so putting language aside, VBA is currently more fulfilling and quicker to get things done, although there are increasing capabilities built in to apps script to make it extremely promising.
I am logging the progress of my migration, and the things I come across and the battles to figure out how to minimize structural change (I am trying to see if I can come up with something that would allow dual maintenance on both platforms), so if you are interested, you can follow along here
http://ramblings.mcpher.com/Home/excelquirks/gooscript
Bruce
The VBA in Office has been the same for about 10 years now, still using old VB6. The limitations of that language are endless. No data structures, no logic short-circuiting, limited types, non-object oriented. Google Apps and javascript are presumably on the forefront of technology and so it should not have many of these limitations.
As for what each is capable of doing that the other can't, that's a little more difficult to assert. I would argue that both languages are more or less turing complete, so while it may be more or less difficult to do something in each language, in theory, a good enough team of programmers could do just about anything in either.
Cheers :D
I'm trying to create charts in google spreadsheet using google apps script and is seems not possible... It is fairly easy in VBA, maybe vb6 is 10 years old but on the other hand you're able to do everything what you need with your spreadsheet. This is not the case in google scripts though.
One of the major hurdles is that Google Apps is web based. Thats were most companies cringe at the thought that you would have your own data not stored securely within your own network. I would never trust Google with that sort of data. I'm sure they have secure data connectors, but why take that risk?
Sure VBA is outdated, and not as sexy as javascript. However, its a great tool for quickly writing small applications, and getting it to the user fast. You only really hear nightmare stories about applications that were built by non-programmers using VBA.
It really depends on your project, and what you want to accomplish. Both have their limitations.
Having taken a quick look at Google Spreadsheet API I get the impression that its currently somewhat limited, for instance:
fewer Events, no control of calculation?, no way of writing UDFs?
Has anyone tried using it for serious work?
By its nature, a Google spreadsheet will not be able to do many things a local program will do. Example: a macro that would import all csv files in a user specified folder and consolidate them.
One thing that springs to mind is that VBA has full access to the WinAPI through 'Declare Function' declarations. Google Apps script won't have this access. This is something to watch for if you're converting a spreadsheet between the two.

Web testing and keeping track of areas tested

I have a huge web application and I want to use a system which will help the developers keep track of areas (links) that have been visited and tested. I am not looking for a bug tracking system, etc. Just a system that will help me track pages that I have visited, etc.
Let me know if there is a tool to keep track of pages physically visited and signed off.
I don't know any out-of-the-box solution to do this.
If nothing comes up, you might be able to put something together using frames. You could have your site in the top frame, and the tracking application in a tiny bottom frame. The bottom frame would constantly update itself and tell you whether the URL in the big frame is in the list of visited pages. You would need some server side programming for that (e.g. PHP) and it would be some work, but nothing impossible.
I am also not aware of any Tools that are available for this. However, without any tools, you can still have developers give you a snapshot of browser history which shall give you this info. Alternatively depending on the webserver you are using, you can write simple scripts to scan through the access logs and generate a report of all the pages visited (uniquely and otherwise) and compare, if needed.
If you want to just track where you're visited you might consider pulling the data out from your browser history or, if you have access to them, server logs.
But I would consider writing, or recording—or creating somehow—actual automated tests for your web app esp. given its size.
SimpleTest provides a, now quite mature, web tester. I heard things about it integrating with Selenium. You can also use Watir which I know will run with Ruby but possibly more than that. Watir has the advantage that you can test multiple browsers. I'm sure there are plenty more tools if you do a few searches.