Exemplo n.º 1
0
        public static YoutubeSearch ForChannelId(this YoutubeSearch search, string id)
        {
            var settings = search.Settings.Clone();

            settings.ChannelId = id;
            return(Search(settings));
        }
Exemplo n.º 2
0
        public static YoutubeSearch ForCountry(this YoutubeSearch search, string regionCode)
        {
            var settings = search.Settings.Clone();

            settings.RegionCode = regionCode;
            return(Search(settings));
        }
Exemplo n.º 3
0
        public static YoutubeSearch OrderBy(this YoutubeSearch search, SearchOrder order)
        {
            var settings = search.Settings.Clone();

            settings.Order = order;
            return(Search(settings));
        }
Exemplo n.º 4
0
        public static YoutubeSearch PublishedAfter(this YoutubeSearch search, DateTime d)
        {
            var settings = search.Settings.Clone();

            settings.PublishedAfter = d;
            return(Search(settings));
        }
Exemplo n.º 5
0
        public ActionResult Index()
        {
            string apiKey = System.Web.Configuration.WebConfigurationManager.AppSettings["ytAPIKey"];

            //Create the request to the API
            WebRequest request = WebRequest.Create("https://www.googleapis.com/youtube/v3/search?part=snippet&q=pokemon&key=" + apiKey);

            //Send that request off
            WebResponse respone = request.GetResponse();

            //Get back the response stram
            Stream stream = respone.GetResponseStream();

            //Make it accessible
            StreamReader reader = new StreamReader(stream);

            //Put into string , which is json formatted
            string resposneFromServer = reader.ReadToEnd();

            JObject parsedString = JObject.Parse(resposneFromServer);

            YoutubeSearch mySearch = parsedString.ToObject <YoutubeSearch>();



            return(View(mySearch));
        }
Exemplo n.º 6
0
        public static YoutubeSearch SafeSearch(this YoutubeSearch search, SafeSearch s)
        {
            var settings = search.Settings.Clone();

            settings.SafeSearch = s;
            return(Search(settings));
        }
Exemplo n.º 7
0
        public static YoutubeSearch RelatedToVideoId(this YoutubeSearch search, string id)
        {
            var settings = search.Settings.Clone();

            settings.RelatedToVideoId = id;
            settings.Type             = ResourceKind.Video;
            return(Search(settings));
        }
Exemplo n.º 8
0
    private void Awake()
    {
        youtubeSearch = new YoutubeSearch();
        videoImages   = new List <VideoImage>();

        for (int i = 0; i < numVidsPerQuery; ++i)
        {
            addNewVideoImageObject();
        }
    }
Exemplo n.º 9
0
        public static YoutubeSearch OfType(this YoutubeSearch search, ResourceKind t)
        {
            if (t != ResourceKind.Video && t != ResourceKind.Playlist && t != ResourceKind.Channel)
            {
                throw new InvalidOperationException();
            }

            var settings = search.Settings.Clone();

            settings.Type = t;
            return(Search(settings));
        }
Exemplo n.º 10
0
        //POST: AttendeeSongRequest
        public ActionResult _PartialAttendeeSongRequest(Songs song)
        {
            YoutubeSearch songSearch    = new YoutubeSearch();
            var           searchResults = songSearch.SearchByTitle(song.Title);
            List <string> songList      = new List <string>();

            for (var i = 0; i < searchResults.Count; i++)
            {
                string result = searchResults[i][0];
                songList.Add(result);
            }
            Playlist model = new Playlist();

            model.Title      = song.Title;
            ViewBag.SongList = songList;
            return(View("SongSearchResults"));
        }
Exemplo n.º 11
0
        //POST: queue the attendees final selection
//GET: adds attendees song to the playlist

        public ActionResult SearchResult(string Title)
        {
            var user = User.Identity.GetUserId();
            var w    =
                (from q in db.EventUsers
                 where q.AppUserId == user
                 select q).FirstOrDefault();

            YoutubeSearch songSearch    = new YoutubeSearch();
            var           searchResults = songSearch.SearchByTitle(Title);

            var      selectedSong = searchResults.Select(x => searchResults[0]).First();
            Playlist song         = new Playlist();

            song.Title       = selectedSong[0];
            song.YoutubeID   = selectedSong[1];
            song.PhoneNumber = w.PhoneNumber;
            db.Playlist.Add(song);
            db.SaveChanges();

            return(View("AttendeeIndex"));
        }
Exemplo n.º 12
0
        private void MainForm_Load(object sender, EventArgs e)
        {
            var screen = Screen.FromPoint(this.Location);

            this.Location = new Point(screen.WorkingArea.Right - this.Width, screen.WorkingArea.Bottom - this.Height);

            // setup the search and events when video list and thumb images
            // are updated
            searcher = new YoutubeSearch();
            searcher.VideoUpdated   += videoListUpdated;
            searcher.ImageUpdated   += imageUpdated;
            searcher.CommentUpdated += commentUpdated;

            // detects when mouse is clicked over the surface of
            // the web browser
            viewer.DocumentCompleted += Viewer_DocumentCompleted;

            SendMessage(this.searchText.Handle, 0x1501, 1, "keywords");

            // start the clock to wait for the searching
            runSearchThread();
        }
Exemplo n.º 13
0
 public static IEnumerable <YoutubeSearchResult> TakePages(this YoutubeSearch search, int pageCount)
 {
     return(search.Take(search.ResultsPerPage.GetValueOrDefault(ResultsPerPage) * pageCount));
 }
Exemplo n.º 14
0
        public string Execute()
        {
            YoutubeSearch sr = new YoutubeSearch(this.Parameters[1], int.Parse(this.Parameters[2]));

            return(sr.GetResults());
        }
Exemplo n.º 15
0
 public static YoutubeSearch OrderByViewCount(this YoutubeSearch search)
 {
     return(search.OrderBy(SearchOrder.ViewCount));
 }
Exemplo n.º 16
0
 public static YoutubeSearch OrderByTitle(this YoutubeSearch search)
 {
     return(search.OrderBy(SearchOrder.Title));
 }
Exemplo n.º 17
0
 public static YoutubeSearch OrderByRelevance(this YoutubeSearch search)
 {
     return(search.OrderBy(SearchOrder.Relevance));
 }
Exemplo n.º 18
0
 public static YoutubeSearch OrderByRating(this YoutubeSearch search)
 {
     return(search.OrderBy(SearchOrder.Rating));
 }
Exemplo n.º 19
0
 public static YoutubeSearch OrderByDate(this YoutubeSearch search)
 {
     return(search.OrderBy(SearchOrder.Date));
 }
Exemplo n.º 20
0
 public static YoutubeSearch OfTypeVideo(this YoutubeSearch search)
 {
     return(search.OfType(ResourceKind.Video));
 }
Exemplo n.º 21
0
 public static YoutubeSearch OfTypeChannel(this YoutubeSearch search)
 {
     return(search.OfType(ResourceKind.Channel));
 }
Exemplo n.º 22
0
 public static YoutubeSearch OfTypePlaylist(this YoutubeSearch search)
 {
     return(search.OfType(ResourceKind.Playlist));
 }
Exemplo n.º 23
0
 public static IEnumerable <YoutubeSearchResult> TakePage(this YoutubeSearch search)
 {
     return(search.TakePages(1));
 }