Last active
July 21, 2017 15:53
-
-
Save garrettmac/6dda7e412a35ea4bc431e59f8e9f1016 to your computer and use it in GitHub Desktop.
politi.cc injection
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
// Initialize Firebase | |
// TODO: Replace with your project's customized code snippet | |
var config = { | |
apiKey: "AIzaSyANxoHymSH5QMTrVXI0Njg-VBy4-oaoV1M", | |
authDomain: "newsoria-33414.firebaseapp.com", | |
databaseURL: "https://newsoria-33414.firebaseio.com" | |
}; | |
firebase.initializeApp(config); | |
class Greeting extends React.Component { | |
state={ | |
data:[] | |
} | |
componentDidMount(){ | |
console.log("hello sicko") | |
this.data = [] | |
firebase.database().ref('articles/news/sources/the-next-web/latest/2016/12/15').orderByChild('publishedAt').limitToLast(10).on('child_added', | |
(snapshot) => { | |
console.log("--------->>>> CHAT ADDED ",snapshot.val()); | |
//this.data.unshift( {id: snapshot.key, postData: snapshot.val()} ) | |
this.setState({data:snapshot.val()}) | |
// this.setState({ | |
// dataSource: this.state.dataSource.cloneWithRows(this.data) | |
// }) | |
//this.setState({ isLoading: false }) | |
}) | |
} | |
render() { | |
return (<div> | |
{this.state.data.map(o=>{ | |
return (<div className="row sqs-row"> | |
<div className="col sqs-col-4 span-4"> | |
<div className="sqs-block image-block sqs-block-image" data-aspect-ratio="100" data-block-type="5" id="block-c54079c5ec9286d2faeb"> | |
<div className="sqs-block-content"> | |
<div className="sqs-image sqs-empty"> | |
<div className="sqs-image-content" style={{paddingBottom: '100.0%'}}></div> | |
</div> | |
</div> | |
</div> | |
</div> | |
<div className="col sqs-col-8 span-8"> | |
<div className="sqs-block html-block sqs-block-html" data-block-type="2" id="block-75a8017ddd7199db03ad"> | |
<div className="sqs-block-content"> | |
<h3>{o.author}</h3> | |
<p>{o.description} | |
</p> | |
</div> | |
</div> | |
<div className="sqs-block button-block sqs-block-button" data-block-type="53" id="block-3decbf7d2072b81f7d6b"> | |
<div className="sqs-block-content"> | |
<div className="sqs-block-button-container--left" data-alignment="left" data-button-size="small"> | |
<a href="" className="sqs-block-button-element--small sqs-block-button-element" data-initialized="true">Learn More</a> | |
</div> | |
</div> | |
</div> | |
</div> | |
</div>)})} | |
</div>); | |
} | |
} | |
ReactDOM.render( | |
<Greeting />, | |
document.getElementById('root') | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment