• Post Reply Bookmark Topic Watch Topic
  • New Topic

Using Java to interact with a web browser  RSS feed

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
First post here I have made a simple program that will read in a text file full of songs. Each line in the file has 1 song, each line is then stored in an array. My plan is to use the songs in the array and search for it through youtube and then possibly load the first video result that YouTube finds. If anyone could help me with the YouTube searching part I would be very grateful. I know what I have made so far is a beginner application but as for browser interaction, i'm sure it will be more advanced but i'll try my best.
 
Author and ninkuma
Marshal
Posts: 66307
152
IntelliJ IDE Java jQuery Mac Mac OS X
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Interacting with a web browser is a needless complication. Google has APIs that you can use to search from your program; why get a browser involved?
 
Chris Caldwell
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry big fella, i'm only a beginner so didn't know that. Thanks
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66307
152
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My point is that taking the web browser out of the equation will make your task far far easier.
 
Ranch Foreman
Posts: 3068
37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bear Bibeault wrote:My point is that taking the web browser out of the equation will make your task far far easier.


Well, until actually trying to play the video...

Unless "possibly load the first video result that YouTube finds" doesn't mean "play".
 
Chris Caldwell
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well at the minute I could simply have an application that will load the first result and grab the URL, with no intention of playing it.
Another variation would be to have a sort of music player that will grab the url and launch it in the browser for playing, which could be useful for a party.
I'm aiming for the first option, so if I learn how to use Google's own API will I be able to grab the URL of the video?

EDIT: Thanks for the advice on using youtube/google API as I have finally managed to convert a text file of song names into an array of youtube URLs
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!