예제 #1
0
     // $entry = simplexml_load_file($feedURL);
     // $video = $mc->parseVideoEntry($entry);
     // echo " amazing titlte = ".$video->title;
     $_SESSION['article_title'] = $mc->get_youtube_title($video_id);
     // $_SESSION['article_title'] = 'THIS IS THE TITLE OF THE  VIDEO ';
     // echo " youtube link <br> ";
 } else {
     echo " not youtube link <br> ";
     $mc->web_scraping(array('get' => array('video'), 'url' => $url, 'accept_video' => array('youtube'), 'accept_image' => array('jpg', 'png'), 'size' => array('image' => array('height' => 100, 'width' => 150), 'video' => array('height' => 200, 'width' => 1200)), 'limit' => 20));
     echo " this is the title {$_SESSION['article_title']} <br> ";
     // $_SESSION['article_video']  embeded code url
     $video_id = $mc->get_video_id($_SESSION['article_video'][0]);
     # remove space
     $_SESSION['video_id'] = $mc->string(array('type' => 'remove-space', 'string' => $video_id));
     $src = $mc->get_video_src($_SESSION['article_video'][0], $video_id);
     $_SESSION['article_title'] = $pa->get_title_in_a_website($url);
 }
 // echo " video id = $video_id  <br> ";
 // echo " this is the title $_SESSION[article_title] ";
 // echo " video_id =  $video_id  <br> ";
 // print image
 // image
 $data_image = $_SESSION['article_image'];
 $data_image_len = count($_SESSION['article_image']);
 // video
 $data_video = $_SESSION['article_video'];
 $data_video_len = count($_SESSION['article_video']);
 //init attr
 $current_index = $_SESSION['current_index_image'] = 0;
 $title = $_SESSION['article_title'];
 $description = $_SESSION['article_description'];
예제 #2
0
 public function add_new_info_no_email($url, $mc, $desc = null)
 {
     $pa = new postarticle();
     $name = $pa->get_title_in_a_website($url);
     //get name of the user via title
     $name = str_replace('| LOOKBOOK', '', $name);
     //get user name
     $data = $this->get_blog_tlook_location($url, $mc);
     //get the location blog website
     $invited_status = 6;
     //set as pending but no email
     $domain = mysql_escape_string($data['domain']);
     //domains of the user
     $tlook = intval($data['tlook']);
     //total look uploaded
     $location = $desc == null ? mysql_escape_string($data['location']) : mysql_escape_string($desc);
     //address of the user
     $scrape_src = mysql_escape_string($_SESSION['scrape_src']);
     //url of the page lookbook/user?page=1
     if (!empty($domain)) {
         echo "<span style='color:green' > domain found </span><b> {$domain}</b><br>";
         if (!select_v3('fs_invited', '*', "invited_fn='{$name}'")) {
             echo "INSERT INTO fs_invited (invited_wob,tlook,description,invited_fn,invited_email,invited_date,invited_status,scrape_src) values( '{$domain}' , {$tlook} , '{$location}' , '{$name}' , '{$email}' , '{$mc->date_time}',{$invited_status},'{$scrape_src}') ";
             $response = mysql_query("INSERT INTO fs_invited (invited_wob,tlook,description,invited_fn,invited_email,invited_date,invited_status,scrape_src) values( '{$domain}' , {$tlook} , '{$location}' , '{$name}' , '{$email}' , '{$mc->date_time}',{$invited_status},'{$scrape_src}') ");
             //insert information to fs database
             $mc->message(" no email but  ", $response, ' adding information ');
             //print message status of the data from lookbook scrapped successfully inserted or not
         } else {
             echo "user <span style='color:red' >  already </span> in the database <b> {$name} </b>";
         }
     } else {
         echo "<span style='color:red'>no domain and email found</span>";
     }
 }
예제 #3
0
파일: test.php 프로젝트: jesus143/fs-dev
            */
            echo " url1 = {$url} <br>";
            // $article_len =  count($article);
            echo "<hr>";
            if (strpos($url, 'youtube.com')) {
                // $pa->test_get_images_from_url( $url );
                $video_array = $pa->video($url);
                // echo "youtube";
                echo ' 	
								<h1> "' . $video_array[0]['vtitle'] . '"</h1> 
								<h2> "' . $video_array[0]['vdescription'] . '"</h2> 
								<li> 
									<iframe width="560" height="315" src="//www.youtube.com/embed/' . $video_array[0]["vid"] . '" frameborder="0" allowfullscreen></iframe>
								</li>';
            } else {
                $title = $pa->get_title_in_a_website($url);
                $desc = $pa->get_meta_data($url, 'description');
                $desc_content = $pa->get_descriptions($url);
                $desc = $pa->change_description_if_lessthan50($desc, $desc_content, 20, 1000);
                $article = $pa->get_image_article($url, $ri, 100);
                $article = $pa->remove_duplicate($article, $url);
                $article_len = count($article);
                $limit_display = 100;
                if ($article_len > 0) {
                    echo "<h1> {$title}  </h1> <h1> {$desc}.... </h1> <h1> </h1>";
                    unset($_SESSION["article"]);
                    $_SESSION["article"] = $article;
                    for ($i = 0; $i < $article_len; $i++) {
                        if ($i < $limit_display) {
                            $article1 = $article[$i]['img_source'];
                            if ($i == 0) {