Another link to view details
Friend_01 account
65 4.3.2- Videos Category
This category automatically retrieves all posted videos from the developer’s as well as friend’s accounts with name, message and link. Here we used three Facebook accounts, one is developer’s account and other two accounts are the friend’s accounts who installed the application. Figures 4.11(a) shows all posted videos with name, message and link of the shared
Fig. 4.10(f) One of the selected links of the posted pictures (another friend account)
Fig. 4.10(g) Details of the selected link
Friend_02 Account Another link to view details
66 posts. Figures 4.11(b), 4.11(c) show the selected URL of the posted videos and details of the selected URL of the post (developers account). Figures 4.11(d), 4.11(e), 4.11(f), 4.11(g) show the selected URL of the posted videos and details of the selected URL of the post (friends account).
In this section, we followed the entire algorithm defined in the 3.3.1 section except the 14thstep of the algorithm. Instead of the 14thstep of the algorithm we followed below steps:
1. Check string liststr for “name”, “link” in list1 using Contains () method. If yes, check for videos. Again if yes, retrieve name, message and link with the user entered no. of likes.
3.
Repeat these steps for each post in the list1 using foreach statement.Fig.4.11 (a) Posted videos from the developer’s and friends account
67 Fig.4.11 (b) One of the selected link of the posted videos (developer’s account)
Fig. 4.11(c) Video of the selected link
Fig. 4.9(d) One of the selected links of the posted video (friend account)
Developers account
68 Fig. 4.11(e) Corresponding video of the selected link
Fig. 4.9(f) One of the selected links of the posted videos (another friend account)
Fig. 4.11(g) Corresponding video of the selected link
Friend account
Friend account
69 4.4 Search and Play YouTube Videos
This section describes how to search and play YouTube videos in the system. Figure 4.12(a), 4.12(b) and 4.12(c) shows search box to enter keyword, YouTube results from the related keyword and video from the selected link of the entered keyword. We used following steps to add this feature on website:
1.
The feature needs to communicate with the Google Search API. For the same, we require a third-party DLL to be referenced by our application. So we need to download third –party DLL called “Google Search API” as following:GoogleSearchAPI.dll2.
Add “GoogleSearchAPI.dll” to the BIN folder of our application3.
Add namespace as “Google.API.Search” in the code-behind file (aspx.cs)4.
Use following controls to layout the feature - TextBox for keyword- Button to search YouTube videos of related keyword
- Datalist (two Hyperlinks to show the search result title with image and duration of video).
- AJAX ModalPopupExtender to play selected video in popup panel with an Iframe:
5.
Add JavaScript and CSS code in the head tag for the Popup panel design and popup hide/show6.
To pass TextBox value in the button click to the Google server follow below steps in the button click event- create new dataset with an object as below
- create an object of datatable with columns “Title”, “PlayUrl”, “Url” and
“Duration”
- create an instance of “GvideoSearchClient” class by passing www.Facebook.com as the client because it requires the hosted site for security purpose.
DataSetds
DataTabledt (Title, PlayUrl, Url, Duration)
GvideoSearchClientGVideo (www.Facebook.com)
70 - Create IList Interface by passing textbox value with limit of the results (50). We can
decrease or increase the results value as needed.
7.
Bind all video search results from the “IList” to the data table and then to datalist control.8.
Execute the feature, enter search query and press button to enjoy this feature.AJAX ModalPopupExtender–The AJAX Control Toolkit is a shared source library of ASP.NET controls. ModalPopupExtender is one of the Ajax control. It takes the markup generated by a server-side ASP.NET panel and shows or hides it as the user clicks on particular HTML element. In the application, this control is used to play videos in a popup panel.
Overall, User can input the query in the TextBox to search and play the YouTube videos on the web page. Here the application has been enabled to display fifty search results on the web page.
To play the video can click on any result.
IList<IVideoResult> results GVideo.Search (TextBox1.Text, 50);
Fig. 4.12(a) Search box for YouTube videos
71 Fig. 4.12(b) YouTube results for “Graph API” keyword
Fig. 4.12(c) Playing Video from the selected link of “Graph API google results”
72 4.5 Google Search
This section describes how to add Google search feature in the system. Figure 4.13(a), 4.13(b) and 4.13(c) shows search box to enter keyword, Google search results and corresponding site from the selected link. We used following steps to add this feature on website:
1. The feature needs to communicate with the Google Search API. For the same, we require a third-party DLL to be referenced by our application. So we need to download third –third-party DLL called
“Google Search API” as :GoogleSearchAPI.dll
2. Add “GoogleSearchAPI.dll” to the BIN folder of our application
3. Add namespace as “Google.API.Search” in the code-behind file (aspx.cs) 4. Use following controls to layout the feature
- TextBox for keyword - Button to search
- Datalist (one LinkButton is used to show the search result title with link and label to show the search description).
5. To pass TextBox value in the button click to the Google server follow below steps in the button click event
- create new dataset with an object as below
- create datatable with an object with columns “Title”, “PlayUrl”, “Url” and
“Duration”
- create an instance of “GWebSearchClient” by passing www.Facebook.com as the client because it requires the hosted site for security purpose.
- Create IList Interface by passing textbox value with limit of the results (50). We can decrease or increase the results value as needed.
DataSetds
DataTabledt (Title, Content, Url)
GWebSearchClientGWeb (www.Facebook.com)
IList<IWebResult> results GWeb. Search (TextBox1.Text, 50);
73 6. Bind all video search results from the “IList” to the data table and then to datalist control.
7. Execute the feature, enter search query and press button to enjoy this feature
Fig. 4.13(a) Google search box
Fig. 4.13 (b) Google results
74 Fig. 4.11(b) Google search results
Fig. 4.13(c) Corresponding site of the selected link
75