This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
response = requests.get(link, headers=HEADER) | |
soup = BeautifulSoup(response.text, "html.parser") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from bs4 import BeautifulSoup | |
import requests | |
HEADER = { | |
"User-Agent": 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.102 Safari/537.36' | |
} | |
link = "https://www.youtube.com/watch?v=qZp5gf9xgnE" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"time" | |
"crypto/sha256" | |
"encoding/hex" | |
"strconv" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import ReactDOM from 'react-dom'; | |
import './index.css'; | |
import App from './App'; | |
import * as serviceWorker from './serviceWorker'; | |
import ReadMoreLess from 'read-more-less-toggle'; | |
ReactDOM.render(<ReadMoreLess len="30" content="If you are here, I assume that you are tired of searching email verification through Django And React" | |
btnColor="white" btnBackgroundColor="black" />, document.getElementById('root')); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from 'react' | |
import '../App.css'; | |
export default class ReadMoreLess extends Component { | |
constructor() { | |
super(); | |
this.state = { | |
showMore: false | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var path = require('path'); | |
module.exports = { | |
mode: 'production', | |
entry: './src/ReadMoreLess.js', | |
output: { | |
path: path.resolve('lib'), | |
filename: 'ReadMoreLess.js', | |
libraryTarget: 'commonjs2' | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "read-more-less-toggle", | |
"version": "1.10.0", | |
"description": "a simple react package to provide read more or less feature on paragraph", | |
"main": "./lib/ReadMoreLess.js", | |
"scripts": { | |
"start": "webpack --watch", | |
"build": "webpack" | |
}, | |
"repository": { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const NewsCard = (props) => { | |
const singleNews = props.singleNews | |
return( | |
<div className="col-md-12 news-card"> | |
<div className="card"> | |
<div className="card-body d-flex flex-row"> | |
<div className="float-right ml-3 w-75"> | |
<h5 className="card-title"> {singleNews.title} </h5> | |
<p> {singleNews.content} </p> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class NewsList extends Component { | |
componentDidMount() { | |
this.refs.iScroll.addEventListener("scroll", this.handleOnScroll); | |
} | |
componentWillUnmount() { | |
this.refs.iScroll.removeEventListener("scroll", this.handleOnScroll); | |
} | |
handleOnScroll = () => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Query query={NEWS_FETCH} variables={{ country: country, after: "" }}> | |
{({ data, loading, fetchMore }) => { | |
const allNews = data ? data.allNews : [] | |
const endCursor = data ? data.allNews.pageInfo.endCursor : "" | |
if(data) | |
if (allNews.edges.length == 0) return (<p>No News Found</p>) | |
return ( |