Is there a tool/API to extract Minecraft recipes? - java

A friend and I decided to code a discord bot in Java, using JDA. The idea is for the bot to give you a request Minecraft recipe (a picture of it). However, we don't want to have to download every single recipe (there are way too many of them). So I was wondering if there's something we can use that would give us the recipes with pictures and everything, like an API or a website that we can access from the Java code that would return something we can use. (No code attached since we haven't really done anything and it would serve no purpose).

I am not sure if an API exists that can do that for you. If the problem is spending the time to download every single recipe I might recommend creating a webscraper that could get that data from you. Getting the images from a site like https://www.minecraftcrafting.info/ would be fairly straight forward using python and beautifulsoup (https://pypi.org/project/beautifulsoup4/). Hope that helps and good luck!

Related

How can I make my java program retrieve data sets online?

Currently I am working on a program that will assist me for making decisions when trying to bet on sports. My goal is for the program is that each day I would like to retrieve things like weather, past games, player/team stats etc. then aggregate it all so that I can see which teams make the most sense to bet on.
I'm not exactly sure if it's even possible to do on IntelliJ, the text editor I'm using, because I do not think its connected to the internet on its own. I think one approach would be to use a separate program (not IntelliJ) to automatically go to each website and copy the appropriate information into an excel document; then I could copy the file into my project each day before I run it. Something like that is what I have in mind, but I would appreciate some help if anyone knows which strategy I could use to move past this obstacle.
I've recently learned how to and created a GUI to navigate my program a little easier than through the console; therefore, my work ethic is not an barrier in this instance. I've taken one programming class in college and would consider myself an apprentice (one step above a novice).
You can use jsoup for scraping data from a website, Then you can use Apache POI to add it to an excel file.
Heres the website https://jsoup.org/
Heres a good tutorial about apache POI https://www.baeldung.com/java-microsoft-excel

Connecting to API

I plan to build a simple website that takes data from a websites API and puts it into charts that are listed on my website. Here is what I am trying to do:
Take data from the API listed on localbitcoins.com
https://localbitcoins.com/api-docs/
Code a program that parses this data as I see fit.
Create a graphical layout that displays the data.
Post the graphs on a website that I have created, ideally to update in real-time.
I don't know where to begin.
I am not asking for some one to hold my hand through it all, but more so to give me some pointers on where to start, what resources are there that I can look at, and so on.
My instinct tells that that I need to tackle API and coding part first. Can someone point me to a resource that could take me through this? Should I stick with Java or should I use another language for this?

Want to transfer information contained in a database in one iteration of an app to another iteration on a different phone

I consider myself an accomplished programmer, but I'm relatively new to Android App development. I'm creating an application that will store information into the SQLite database used in Android. What I'd like to be able to do is be able to take a query of that data and export it either as a file of some sort or just send it to another iteration of the same application on a different phone. Then be able to have that phone import the same information into its own database, seeing that the information should line up correctly as long as it keeps it.
Can anyone provide some good starting examples of how I would best go about this and/or tutorials on how to go about doing it? Right now I'm just not sure how to get started and I could use some help to push me in the right direction, so I'd really appreciate the help.
Thank you ahead of time to anyone who replies.
and export it either as a file
depends on what kind of data you have. You can write any kind of text-based data using a RandomAccessFile for example.
send it to another iteration of the same application on a different
phone
You will need to have your own backend to do so. You could identify the target device by using GCM

Wrting Objects to a file and searching through them in an Android App

I want to create an android that allows the user to enter data, like name and id number. I want to save that data as an object, to a file. I know I can do that using ObjectOutputStream, which I did, and it works. However, I also want the user to come back later, be able to add more entries to the same file, and search through his/her previous entries. I know that only RandomAccessFile has that capability, but I still want to write objects since it's easier to deal with.
Does anyone have any tips on what's the best way to approach this?
I am aware of this post, but I am not sure if I can use the libraries mentioned there on android. I was also looking at SQLite, but I have no experience with it and I am not sure if it's the right option for me.
Thanks in advance!

Getting Google results in Java? Need help!

Right now, I'm trying to get the results from Google in Java, by searching for a term. I'm using a desktop program, not an applet.
That in itself isn't complicated. but then Google gave me a 403 error. Anyways, I added referrer and User Agent and then it worked.
Now, my problem is that I don't get the results page from Google. Instead, I get their script which gets the results page.
My code right now simply uses a GET request on "http://www.google.com/search?q=" + Dork;
Then it outputs each line.
Here is what I get when I run my program:
<.!doctype html><.head><.title>dork - Google Search<./title><.script>window.google={kEI:"9myaS-Date).getTime()}}};try{}catch(u){}window.google.jsrt_kill=1;
align:center}#logo{display:block;overflow:hidden;position:relative;width:103px;height:37px;
<./ script><./div>
Lots of stuff like that. I shortened it (A LOT) and put in dots to fit it here.
So my big question is:
How do I turn this whole mess into the nice results page I get when searching Google with a browser?
Any help would be seriously appreciated, and I really need the answer fast.
Also, please keep in mind that I do NOT want to use Google's API for this.
Thanks in advance!
Jack is right, take a look at the Google AJAX APIs. If you want nicely formatted results, brush up on your html and css.

Categories

Resources