Activity Stream
48,167 MEMBERS
6987 ONLINE
besthostingforums On YouTube Subscribe to our Newsletter besthostingforums On Twitter besthostingforums On Facebook besthostingforums On facebook groups

Page 1 of 2 12 LastLast
Results 1 to 10 of 17
  1.     
    #1
    ლ(ಠ益ಠლ)
    Website's:
    extremecoderz.com

    Default [c#] IMDB Info Grabber (Full program)

    Ok.

    Here is a handy little application - fully working - that obtains information from IMDB.com.

    Fundamentally you can go much further, but im releasing the code thus far so users can learn from the code and how its used.

    useage: enter a movie URL into the textbox and click search.
    Example: http://www.imdb.com/title/tt0892318/

    Download Link (exe):
    http://www.coding.extremecoderz.com/IMDBGrabber.rar
    Download Link (solution): http://www.coding.extremecoderz.com/IMDBsol.rar

    Anyway. without further ado:

    Form1.cs Source:
    PHP Code: 
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Linq;
    using System.Text;
    using System.Windows.Forms;

    using System.Threading;
    using IMDBGrabber;

    namespace 
    IMDBGrabber
    {
        public 
    partial class Form1 Form
        
    {
            public 
    Form1()
            {
                
    InitializeComponent();
            }

            private 
    delegate void DisplayStatus(string infoint progressint maxProgress);
            private 
    void Status(string infoint progressint maxProgress)
            {
                
    toolStripProgressBar1.Maximum maxProgress;
                
    toolStripProgressBar1.Value progress;
                
    toolStripStatusLabel1.Text info;
            }

            private 
    delegate void DisplayOutput(
                
    string title,
                
    string desc,
                
    string rating,
                
    string votes,
                
    string releaseDate,
                
    string tagLine
                
    );
            
            private 
    void Output(
                
    string title,
                
    string desc,
                
    string rating,
                
    string votes,
                
    string releaseDate,
                
    string tagLine
                
    )

            {
                
    title_tb.Text title;
                
    desc_tb.Text desc;
                
    rating_tb.Text rating " (" votes ")";
                
    releaseDate_tb.Text releaseDate;
                
    tagLine_tb.Text tagLine;
                
            }

            private 
    delegate void displayCoverDelegate(string imageURL);
            private 
    void DisplayCoverImage(string imageURL)
            {
                
    pictureBox1.Image IMDB.getCover(imageURL);
            }


            private 
    void button1_Click(object senderEventArgs e)
            {
                
    Thread myThread = new Thread(DoWork);
                
    myThread.Start();
            }

            private 
    void DoWork()
            {
                
    DisplayStatus DisplayStatus = new DisplayStatus(Status);
                
    DisplayOutput DisplayOutput = new DisplayOutput(Output);
                
    displayCoverDelegate displayCoverDelegate = new displayCoverDelegate(DisplayCoverImage);
                
    Invoke(DisplayStatus"Connecting..."13);

                
    object[] returnValues IMDB.getInfo(textBox1.Text);

                
    Invoke(DisplayOutput,
                    
    returnValues[0].ToString(),
                    
    returnValues[1].ToString(),
                    
    returnValues[2].ToString(),
                    
    returnValues[3].ToString(),
                    
    returnValues[4].ToString(),
                    
    returnValues[5].ToString()
                    );

                
    Invoke(DisplayStatus"Getting Cover Image..."23);

                
    Invoke(displayCoverDelegatereturnValues[6].ToString());

                
    Invoke(DisplayStatus"Ready."33);
            }
            
        }

    IMDB.cs Source:
    PHP Code: 
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;

    using System.Net;
    using System.IO;
    using System.Web;
    using System.Drawing;

    namespace 
    IMDBGrabber
    {
        class 
    IMDB
        
    {

            public static 
    string[] GetStringInBetween(string strBeginstring strEndstring strSourcebool includeBeginbool includeEnd)
            {
                
    string[] result = { """" };
                
    int iIndexOfBegin strSource.IndexOf(strBegin);
                if (
    iIndexOfBegin != -1)
                {
                    if (
    includeBegin)
                    { 
    iIndexOfBegin -= strBegin.Length; }
                    
    strSource strSource.Substring(iIndexOfBegin
                        
    strBegin.Length);
                    
    int iEnd strSource.IndexOf(strEnd);

                    if (
    iEnd != -1)
                    {
                        if (
    includeEnd)
                        { 
    iEnd += strEnd.Length; }
                        
    result[0] = strSource.Substring(0iEnd);
                        if (
    iEnd strEnd.Length strSource.Length)
                        { 
    result[1] = strSource.Substring(iEnd strEnd.Length); }
                    }
                }
                else
                { 
    result[1] = strSource; }
                return 
    result;
            }

            public static 
    object[] getInfo(string url)
            {
                
    HttpWebRequest WebReq;
                
    HttpWebResponse WebResp;
                
    Stream Answer;
                
    StreamReader _Answer;
                
    string[] result;

                
    string ResponseOutput;

                
    WebReq = (HttpWebRequest)WebRequest.Create(url);
                
    WebReq.KeepAlive false;
                
    WebReq.UserAgent "Mozilla/5.0 (Windows; U; Windows NT 6.1; en-GB; rv:1.9.2.4) Gecko/20100611 Firefox/3.6.4";
                
    WebReq.Method "GET";

                
    WebReq.Headers.Add(HttpRequestHeader.AcceptEncoding"gzip, deflate");
                
    WebReq.AutomaticDecompression DecompressionMethods.GZip DecompressionMethods.Deflate;

                
    using (WebResp = (HttpWebResponse)WebReq.GetResponse())
                {
                    
    Answer WebResp.GetResponseStream();
                    
    _Answer = new StreamReader(Answer);
                    
    ResponseOutput _Answer.ReadToEnd();
                }
                
                
    string
                    title
    ,
                    
    description,
                    
    rating,
                    
    votes,
                    
    releaseDate,
                    
    tagLine,
                    
    coverURL;

                
    // rating (VOtes), Main Team. Plot, Main Release Date, Cast
                // Director,Release Date,Genre,Tagline,Plot,Cast,Runtime,Country,Langu age, that will be awesome IMHO

                
    result GetStringInBetween("name=\"title\" content=\"""\">"ResponseOutputfalsefalse);
                
    title HttpUtility.HtmlDecode(result[0]);
                
                
    result GetStringInBetween("name=\"description\" content=\"""\">"ResponseOutputfalsefalse);
                
    description HttpUtility.HtmlDecode(result[0]);

                
    result GetStringInBetween("        <b>""</b> "ResponseOutputfalsefalse);
                
    rating HttpUtility.HtmlDecode(result[0]);

                
    result GetStringInBetween("class=\"tn15more\">""</a>"ResponseOutputfalsefalse);
                
    votes HttpUtility.HtmlDecode(result[0]);

                
    result GetStringInBetween("<h5>Release Date:</h5>\n<div class=\"info-content\">\n""<"ResponseOutputfalsefalse);
                
    releaseDate HttpUtility.HtmlDecode(result[0]);

                
    result GetStringInBetween("<h5>Tagline:</h5>\n<div class=\"info-content\">\n""<"ResponseOutputfalsefalse);
                
    tagLine HttpUtility.HtmlDecode(result[0]);

                
    result GetStringInBetween("<link rel=\"image_src\" href=\"""<"ResponseOutputfalsefalse);
                
    coverURL HttpUtility.HtmlDecode(result[0]);

                return new 
    object[] 
                { 
                    
    title
                    
    description
                    
    rating
                    
    votes
                    
    releaseDate,
                    
    tagLine,
                    
    coverURL
                
    };

            }

            public static 
    Image getCover(string url)
            {
                
    HttpWebRequest WebReq;
                
    HttpWebResponse WebResp;
                
    Image tempImage null;

                
    WebReq = (HttpWebRequest)WebRequest.Create(url);
                
    WebReq.KeepAlive false;
                
    WebReq.UserAgent "Mozilla/5.0 (Windows; U; Windows NT 6.1; en-GB; rv:1.9.2.4) Gecko/20100611 Firefox/3.6.4";
                
    WebReq.Method "GET";

                
    WebReq.Headers.Add(HttpRequestHeader.AcceptEncoding"gzip, deflate");
                
    WebReq.AutomaticDecompression DecompressionMethods.GZip DecompressionMethods.Deflate;

                
    using (WebResp = (HttpWebResponse)WebReq.GetResponse())
                {
                    
    System.IO.Stream _WebStream WebResp.GetResponseStream();
                    
    tempImage Image.FromStream(_WebStream);
                }

                return 
    tempImage;
            }
        }

    jayfella Reviewed by jayfella on . [c#] IMDB Info Grabber (Full program) Ok. Here is a handy little application - fully working - that obtains information from IMDB.com. Fundamentally you can go much further, but im releasing the code thus far so users can learn from the code and how its used. useage: enter a movie URL into the textbox and click search. Example: http://www.imdb.com/title/tt0892318/ Download Link (exe): http://www.coding.extremecoderz.com/IMDBGrabber.rar Rating: 5

  2.   Sponsored Links

  3.     
    #2
    Banned
    Testing it out now!
    Thanx

    Preview

  4.     
    #3
    Member
    Merci beaucoup
    This is the staff, you have been banned

  5.     
    #4
    Member
    Winning isn't always black and white.
    </div>
    </div>

    <div class="info
    Its giving that extra in the Tagline field,, It'd be great if you can give a link to the image


  6.     
    #5
    Member
    Website's:
    FuzzyShare.com
    Great tool, i wonder how useful this will be if it was a forum mod ...

  7.     
    #6
    ლ(ಠ益ಠლ)
    Website's:
    extremecoderz.com
    sec proto. ill fix it in the source.

  8.     
    #7
    Member
    And when there is no poster available, its closing
    Please correct those and an awesome piece buddy


  9.     
    #8
    Member
    Quote Originally Posted by Gat Dat View Post
    Great tool, i wonder how useful this will be if it was a forum mod ...
    There is already one ?


  10.     
    #9
    ლ(ಠ益ಠლ)
    Website's:
    extremecoderz.com
    The whole point really is to take a look at the code and see what is being done and how to go about improving it. I will continue to carry on and make the program as i said, but thought the source could maybe be the beginning of a few personal projects for you guys

  11.     
    #10
    Member
    Website's:
    eih.bz pornDDL.me sexytattoochicks.tumblr.com
    Make it also to upload the image on tinypic or we, it would be a real win mate. Great application, as usual (you know it, so my comment is useless )

Page 1 of 2 12 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. IMDb Info Grabber - Online
    By Apathetic in forum Web Development Area
    Replies: 113
    Last Post: 19th Sep 2012, 03:45 AM
  2. IMDB Info Grabber
    By CJ in forum Web Development Area
    Replies: 11
    Last Post: 14th Jan 2012, 11:04 AM
  3. IMDB Info Grabber
    By soft2050 in forum Webmaster Resources
    Replies: 63
    Last Post: 1st Dec 2011, 12:07 PM
  4. DLE IMDb Grabber Pro
    By Drinkordie in forum Webmaster Resources
    Replies: 0
    Last Post: 30th Sep 2011, 08:04 AM

Tags for this Thread

BE SOCIAL