I was recently inspired by r/place and wanted to do a much smaller version for a community of mine. The large scale idea is to use the twitter API to take user input (via responses to a tweet of mine) and turn it into a real-time updated canvas. I've sorted out how to use the twitter API such that I can pick out tweets with valid colors and coordinates for the grid, but I don't have a way of converting the output of my program into some viewable content online.
My current idea is to update my website every time new valid coordinates and colors are received, and just put a link to my website in the tweet, that way after someone responds to my tweet with the color and coordinates they've picked, they can click the link and be taken to the updated canvas.
The problem is... I don't know how to do ANY of that! I am willing to learn, but I know very little about web development and don't know if any of this is plausible. Is this a good solution? Are there better ones? What are the first steps in converting my programs's outputs into viewable (and live updated) content on the web.
I understand that this problem is kind of vague, but it's mostly because I don't want to rule out viable solutions. Here is the core of the problem:
TLDR:
I need to figure out how to make a live-updated grid/canvas on my website according to a python script.
and
I would like to run the python script on my website's servers instead of having to run it locally on my computer (that way the program can run even when I can't have my computer on)
Would really appreciate if anyone could outline how these things would be done on a high level or point me in the direction of helpful resources!
Thanks in advance!
I am very sorry for the horrendously worded question as I don't know how to phrase it differently. I am currently trying to make a bot play a game like skribbl or kahoot where you join, input a name and play. However I cannot just web-scrape the data with the join link as all the 's are empty and no new player joins. So how can I make a bot that joins the game. I don't necessarily need code. But I need resources to learn, I don't know what this kind of coding would be called.
Given I could just take screenshots frequently of my screen and try to go from there but I feel like it would be better to not do that and I want to expand my knowledge.
If this is not possible in python what other languages would be preferable?
So I'm new to python and just finished my first application. (Giving random chords to be played on a midi piano and increasing the score if the right notes are hit in a graphical interface, nothing too fancy but also non-trivial.) And now I'm looking for a new challenge, this time I'm going to try and create a program that monitors a poker table and collects data on all the players. Though this is completely allowed on almost all poker rooms (example of the largest one) there is obviously no set and go API available. This probably makes the extraction of relevant data the most challenging part of the entire program. In my search for more information, I came across an undergraduate thesis that goes in to writing such a program using Java (Internet Poker: Data Collection and Analysis - Haruyoshi Sakai).
In this thesis, the author speaks of 3 data collection methods:
Sniffing packets
Hand history
Scraping the screen
Like the author, I've come to the conclusion that the third option is probably the best route, but unlike him I have no knowledge of how to start this.
What I do know is the following: Any table will look like the image below. Note how text, including numbers is written in the same font on the table. Additionally, all relevant information is also supplied in the chat box situated in the lower left corner of the window.
In some regards using the chat box sounds like the best way to go, seeing as all text is predictable and in the same font. The problem I see is computational speed: It will often occur that many actions get executed in rapid succession. Any program will have to be able to keep up with this.
On the other hand, using the table as reference means that you have to deal with unpredictable bet locations.
The plan: Taking this in to a count, I'd start by getting an index of all player's names and stacks from the table view and "initialising" the table that way, and continue to use their stacks to extrapolate the betting they do.
The Method: Of course, the method is the entire reason why I made this post. It seems to me like one would need some sort of OCR to achieve all this, but seeing as everything is in a known font, there may be some significant optimisations that can be made. I would love some input on resources to learn about solutions to similar problems. Or if you've got a better idea on how to tackle this problem, I'd love to hear that too!
Please do be sure to ask any questions you may have, I will be happy to answer them in as much detail as possible.
I am trying to scrape everyone's player names from a match when I first connect to a match. I then want to pass these names to an application (I'm guessing I'll use python?) that will connect to dotabuff and scrape each players top 5 hero's played and output them. Is this a reasonable goal?
The examples I have come across seem to demonstrate how to get data after a match is over. I really just need the player names as soon as I connect to the server. Is python the best route to go for this? Any suggestions on other languages I could use?
I have good knowledge of C, C++, Java, and assembly language but am completely new to this field. Thank you in advance for any help.
I don't know about Dota2 specifics and I can't check since no one is currently playing it on my friends list so I'm shooting blanks here, but other Source games allow you to query server information, including player list.
You can read more about it here: https://developer.valvesoftware.com/wiki/Server_queries
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
I teach undergraduate statistics, and am interested in administering personalized online assignments. I have already solved one portion of the puzzle, the generation of multiple version of a question using latex/markdown + knitr/sweave, using seeds.
I am now interested in developing a web-based system, that would use the various versions generated, and administer a different one for each student, online. I have looked into several sites related to forms (google docs, wufoo, formsite etc.), but none of them allow programmatic creation of questionnaires.
I am tagging this with R since that is the language I am most familiar with, and is key to solving the first part of the problem. I know that there are several web-based frameworks for R, and was wondering whether any of them are suitable for this job.
I am not averse to solutions in other languages like Ruby, Python etc. But the key consideration is the ability to programatically deliver online assignments. I am aware of tools like WebWork, but they require the use of Perl and the interfaces are usually quite clunky.
Feel free to add tags to the post, if you think I have missed a framework that would be more suitable.
EDIT. Let me make it clear by giving an example. Currently, if I want to administer an assignment online, I could simply create a Google Form, send the link to my students, and collect all responses in a spreadsheet, and automatically grade it. This works, if I just have one version of the assignment.
My questions is, if I want to administer a different version of the assignment for each student, and collect their responses, how can I do that?
The way you have worded your question it's not really clear why you have to mark the students' work online. Especially since you say that you generate assignments using sweave. If you use R to generate the (randomised) questions, then you really have to use R to mark them (or output the data set).
For my courses, I use a couple of strategies.
For the end of year exam (~500 students), each student gets a unique data set. The students log on to a simple web-site (we use blackboard since the University already has it set up). All students answer the same questions, but use their own unique data set. For example, "What is the mean". The answers are marked offline using an R script.
In my introductory R course, students upload their R functions and I run and mark them off line. I use sweave to generate a unique pdf for each student. Their pdf shows where they lost marks. For example, they didn't use the correct named arguments.
Coupling a simple web-form with marking offline gives you a lot of flexibility and is fairly straightforward.
I found one possible solution that might work using the RGoogleDocs package. I am posting this as an answer only because it is long. I am still interested in better approaches, and hence will keep the question open.
Here is the gist of the idea, which is still untested.
Create multiple versions of each assignment using knitr/Sweave.
Upload them to GoogleDocs using uploadDoc.
Share one document per student using setAccess which modifies access controls.
Create a common Google Form to capture final answers for each student.
The advantage I see is two-fold. One, since all final answers get captured on a spreadsheet, I can access them with R and grade them automatically. Two, since I have access to all the completed assignments on Google Docs, I can skim through them and provide individual comments as required (or let some of my TAs do it).
I will provide an update, if I manage to get this working, and maybe even create an R package if it would be useful for others.
I know that this was asked a long time ago, but I think that today the best solution is the package exams plus Moodle.
The package exams can now generate XML Moodle questions that can be upload to Moodle platform as the students can solve the exercices on-line.
This is an example of a question made with exams package and uploaded to Moodle.
i just stumbled upon the ?exams package in R: Link to the CRAN site. could this be something for you?