diff --git a/package.json b/package.json index 1a08271..a36f4f7 100644 --- a/package.json +++ b/package.json @@ -3,12 +3,8 @@ "version": "0.1.0", "private": true, "dependencies": { -<<<<<<< HEAD "axios": "latest", -======= - "axios": "^0.18.0", "body-parser": "^1.18.3", ->>>>>>> 5ff198adc326a86bc0742f4beeb603992ad7ed5c "bootstrap": "^4.1.3", "express": "^4.16.4", "lodash-id": "^0.14.0", diff --git a/src/GeneralTab.css b/src/GeneralTab.css deleted file mode 100644 index efe335a..0000000 --- a/src/GeneralTab.css +++ /dev/null @@ -1,6 +0,0 @@ -.fade { - opacity: 200; - /* -webkit-transition: opacity .15s linear; */ - -o-transition: opacity .15s linear; - /* transition: opacity .15s linear; */ -} \ No newline at end of file diff --git a/src/GeneralTab.js b/src/GeneralTab.js deleted file mode 100644 index ef9d3da..0000000 --- a/src/GeneralTab.js +++ /dev/null @@ -1,139 +0,0 @@ -import React, { Component } from 'react'; -//import './App.css'; -import './GeneralTab.css'; -import 'bootstrap/dist/css/bootstrap.css'; -import {Tab,Tabs,ListGroup,ListGroupItem} from 'react-bootstrap'; -import axios from "axios"; -import Card from "react-bootstrap/lib/Card"; -import Linkify from 'react-linkify'; -import VideoPlayer from './VideoPlayer'; - -class GeneralTab extends Component { - constructor() { - super(); - this.state = { - comments: [], - info : [] - }; - } - - componentDidMount(){ - //Richiesta per ottenere i commenti del video - axios.get('https://www.googleapis.com/youtube/v3/commentThreads', { - params: { - 'part': 'snippet', - 'videoId': this.state.videoId, //Da sostituire con variabile - 'order': 'relevance', - 'key': 'AIzaSyA21Odw9UdfiOJnxvA_eDfOW0OxuUfHKig' - } - }).then( - response => { - this.setState({ - comments: response.data.items, - }); - }, - error => { - console.error(error); - } - ) - //Richiesta per ottenere le informazioni sul video(Descrizione,dati tecnici,ecc...) - axios.get('https://www.googleapis.com/youtube/v3/videos', { - params: { - 'part' : 'snippet,contentDetails,statistics', - 'id' : this.state.videoId, //Da sostituire con variabile - 'key': 'AIzaSyA21Odw9UdfiOJnxvA_eDfOW0OxuUfHKig' - } - }).then( - response => { - this.setState({ - info : response.data.items, - }); - }, - error => { - console.error(error); - } - ) - } - - render() { - return ( - - -
- {this.state.info.map(function(item,index){ - return( -
-

{item.snippet.title}

- -
ID Video
{item.id}
-
Publish Time
{item.snippet.publishedAt.replace(/(\d+)-(\d+)-(\d+)T(\d+):(\d+):(\d+).000Z/,function(match,p1,p2,p3,p4,p5,p6){ - return(p3+'/'+p2+'/'+p1+' - '+p4+':'+p5+':'+p6); - })} -
-
Channel Name
{item.snippet.channelTitle}
-
Description
{item.snippet.description}
-
Tags
{item.snippet.tags.map(function(element,index){ - return( - {element} - ) - })}
-
-
- ) - } - )} -
-
- -
- {this.state.info.map(function (item,index) { - return( -
-

{item.snippet.title}

- -
Duration
{item.contentDetails.duration.replace(/(PT(\d+)H(\d+)M(\d+)S)|(PT(\d+)M(\d+)S)/,function(match,p1,p2,p3,p4,p5,p6,p7){ - if(p1) return(p2+':'+p3+':'+p4); - else return(p6+':'+p7);})} -
-
Definition
{item.contentDetails.definition}
-
Dimension
{item.contentDetails.dimension}
-
Views
{item.statistics.viewCount}
-
Likes
{item.statistics.likeCount}
-
Dislikes
{item.statistics.dislikeCount}
-
-
- ) - })} -
-
- - - - -
- -
-
-
- ); - } -} - -export default GeneralTab; \ No newline at end of file