Jump to content

Php regular expression help


desteeney

Recommended Posts

Can anyone help me. I have very little knowledge about programming and coding and php, but I am tutoring myself on these.

 

I want to write a code that will search for a movie in this website search =>

http://myandyourface.com/DELETE/imdb-poster.php. NOTE: in searching for the movie, the movie name with more than one word can be type in in combination form by using the + sign. For example, the movie "the vow", typing that into the search box will be so => the+vow.

 

As an example, I got the result as show below:

 

{"Title":"The Vow","Year":"2012","Rated":"PG-13","Released":"10 Feb 2012","Genre":"Drama, Romance","Director":"Michael Sucsy","Writer":"Jason Katims, Abby Kohn","Actors":"Rachel McAdams, Channing Tatum, Sam Neill, Jessica Lange","Plot":"A car accident puts Paige (McAdams) in a coma, and when she wakes up with severe memory loss, her husband Leo (Tatum) works to win her heart again.","Poster":"http://ia.media-imdb.com/images/M/MV5BMjE1OTU5MjU0N15BMl5BanBnXkFtZTcwMzI3OTU5Ng@@._V1_SX320.jpg","Runtime":"N/A","Rating":"N/A","Votes":"N/A","ID":"tt1606389","Response":"True"}

 

So, this is what I wanted to do,

I wanted to write a php code expression that will search for a specific movie and provide the result as above,and then using the regex and str_replace, and others, I will be able to remove all the above detail information and have ONLY the image link as in above, which is => http://ia.media-imdb.com/images/M/MV5BMjE1OTU5MjU0N15BMl5BanBnXkFtZTcwMzI3OTU5Ng@@._V1_SX320.jpg

 

I will appreciate any help in creating a code for this

 

Thanks!

Link to comment
Share on other sites

@KingsPhilip, thank you for the reply. I was not intending to scrape contents from a website; I am trying to obtain specific information from the content that I needed to help me finish other project I am doing.

 

My lack of adequate experience in programming is making it not easy for me to do things the way I wanted. However, I am striving to self-tutor myself and it is gradually working out for me.

 

I did some search on the internet and find a website where the information has been properly formatted using Json. This is what I got =>

 

Title:

Journey 2: The Mysterious Island

 

 

 

Year:

2012

 

 

 

Url:

http://www.imdb.com/title/tt1397514/

 

 

 

Image:

http://ia.media-imdb.com/images/M/MV5BMjA5MTE1MjQyNV5BMl5BanBnXkFtZTcwODI4NDMwNw@@._V1._SY317_.jpg

 

 

 

Director:

Brad Peyton

 

 

 

Writers:

Brian Gunn,Mark Gunn,and 4 more credits

 

 

 

Storyline:

Sean Anderson partners with his mom's boyfriend on a mission to find his grandfather, who is thought to be missing on a mythical island.

 

 

 

Cast:

 

 

 

Josh Hutcherson

 

Sean Anderson

 

 

 

Dwayne Johnson

 

Hank Parsons

 

 

 

Vanessa Hudgens

 

Kailani

 

 

 

Michael Caine

 

Grandfather

 

 

 

Kristin Davis

 

Liz Anderson

 

 

 

Luis Guzmán

 

Gabato

 

 

 

Anna Colwell

 

Jessica

 

 

 

Michael Beasley

 

Marcus

 

 

 

 

 

User Rating:

6.8

 

 

 

Total Votes:

536

 

 

 

Genres:

Action,Adventure,Family

 

 

 

Country:

USA

 

 

 

Language:

English

 

 

 

Runtime:

 

 

 

 

Aspect Ratio:

 

 

 

 

Release Date:

(USA) »

 

 

 

Budget:

 

_______

 

with this information or formatted array display above, I can I be able to get ONLY the image, starting from the http, as like this => http://ia.media-imdb.com/images/M/MV5BMjA5MTE1MjQyNV5BMl5BanBnXkFtZTcwODI4NDMwNw@@._V1._SY317_.jpg

 

I believe this will not be consider as scraping. Please, I just needed a sample coding that can help me to kick off on doing this. If you or anyone have an idea on how to code this, I will really appreciate that.

 

Thanks!

Link to comment
Share on other sites

Robots and Screen Scraping: You may not use data mining, robots, screen scraping, or similar data gathering and extraction tools on this site, except with our express written consent as noted below.

 

Anytime you hit the IMDb web page looking for data, copying it for re-use, it is screen scraping.  The only way around that is an API.  IMDb also has a policy against image leeching, and some fake API's will use a proxy service to get around that policy.  There are legitimate API's out there that use the data files provided by IMDb, but are far and few between.  Seek and ye shall find.

 

Hint: dean clatworthy

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.