Skip to content

Commit

Permalink
Fix news page
Browse files Browse the repository at this point in the history
  • Loading branch information
7kfpun committed Jan 14, 2017
1 parent bc98613 commit 241cf75
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions app/utils/rss.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
function RSS(url) {
const GOOGLE_FEED_API_URL = `https://ajax.googleapis.com/ajax/services/feed/load?v=1.0&num=-1&q=${encodeURIComponent(url)}`;
const RSS = (url) => {
const YAHOO_FEED_API_URL = `https://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20feed%20where%20url%3D%27${encodeURIComponent(url)}%27&format=json&diagnostics=true&callback=`;

return fetch(GOOGLE_FEED_API_URL).then(res => res.json()); // eslint-disable-line no-undef
}
return fetch(YAHOO_FEED_API_URL).then(res => res.json()); // eslint-disable-line no-undef
};

export default RSS;
4 changes: 2 additions & 2 deletions app/views/main/elements/news-cell.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export default class NewsCell extends React.Component {
{this.props.news.title}
</Text>
<Text style={styles.timeText}>
{`${moment(new Date(this.props.news.publishedDate)).format('D/M/YYYY')} at ${moment(new Date(this.props.news.publishedDate)).format('LT')}`}
{`${moment(new Date(this.props.news.pubDate)).format('D/M/YYYY')} at ${moment(new Date(this.props.news.pubDate)).format('LT')}`}
</Text>
</View>
</TouchableHighlight>
Expand All @@ -54,7 +54,7 @@ NewsCell.propTypes = {
news: React.PropTypes.shape({
title: React.PropTypes.string,
link: React.PropTypes.string,
publishedDate: React.PropTypes.string,
pubDate: React.PropTypes.string,
}),
};

Expand Down
2 changes: 1 addition & 1 deletion app/views/main/elements/news-page.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export default class NewsPage extends React.Component {
rss(`https://feeds.finance.yahoo.com/rss/2.0/headline?s=${this.props.stock.symbol}&region=US&lang=en-US`).then((json) => {
console.log(json);
that.setState({
dataSource: that.state.dataSource.cloneWithRows(json.responseData.feed.entries),
dataSource: that.state.dataSource.cloneWithRows(json.query.results.item),
key: Math.random(),
});
});
Expand Down

8 comments on commit 241cf75

@sathyapras
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hi 7kfpun ,
the demo version in google store did not work as actual , do you have a new apk ?
and can you do a custom for me. i just want add : Sign up features , News , text and chart , admob by using back-end ? if you able please let me know , this is my email : sathyaprass@gmail.com , i ll explain more detail, waiting your reply mate.

@7kfpun
Copy link
Owner Author

@7kfpun 7kfpun commented on 241cf75 Jan 18, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok I would update it today. How about a 5 stars rate on Google Play?

@sathyapras
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure ,, please update ,,, i ll give 5 star mate.
what about my other question mate ?

@7kfpun
Copy link
Owner Author

@7kfpun 7kfpun commented on 241cf75 Jan 18, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Examples for AdMob
Bitcoin
Look Lock

Example for AdMob and Facebook Ads
Thai Vocabulary

@7kfpun
Copy link
Owner Author

@7kfpun 7kfpun commented on 241cf75 Jan 18, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The update is on the way. Or you could get the apk on the releases page.

@sathyapras
Copy link

@sathyapras sathyapras commented on 241cf75 Jan 18, 2017 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@7kfpun
Copy link
Owner Author

@7kfpun 7kfpun commented on 241cf75 Jan 18, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some stocks don't have charts. Try GOOG, APPL.
I'm on Mac.

@sathyapras
Copy link

@sathyapras sathyapras commented on 241cf75 Jan 18, 2017 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.