Skip to content

Commit 67aceb7

Browse files
committed
Change samples to use github avatars
The endpoint used to get Facebook photos doesn't work anymore, so use a github id and avatar url instead.
1 parent 950d6ff commit 67aceb7

File tree

8 files changed

+23
-23
lines changed

8 files changed

+23
-23
lines changed

src/React.Sample.Cassette/Content/Sample.jsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,6 @@ var Avatar = React.createClass({
102102
);
103103
},
104104
getPhotoUrl: function(author) {
105-
return 'http://graph.facebook.com/' + author.Facebook + '/picture';
105+
return 'https://avatars.githubusercontent.com/' + author.GithubUsername + '?s=50';
106106
}
107107
});

src/React.Sample.Mvc4/Content/Sample.jsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,6 @@ var Avatar = React.createClass({
101101
);
102102
},
103103
getPhotoUrl(author) {
104-
return 'http://graph.facebook.com/' + author.Facebook + '/picture';
104+
return 'https://avatars.githubusercontent.com/' + author.GithubUsername + '?s=50';
105105
}
106106
});

src/React.Sample.Mvc4/Controllers/HomeController.cs

+6-6
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ namespace React.Sample.Mvc4.Models
2121
public class AuthorModel
2222
{
2323
public string Name { get; set; }
24-
public string Facebook { get; set; }
24+
public string GithubUsername { get; set; }
2525
}
2626
public class CommentModel
2727
{
@@ -54,11 +54,11 @@ public HomeController()
5454
// For clarity, we'll just use a hard-coded list.
5555
_authors = new Dictionary<string, AuthorModel>
5656
{
57-
{"daniel", new AuthorModel { Name = "Daniel Lo Nigro", Facebook = "daaniel" }},
58-
{"vjeux", new AuthorModel { Name = "Christopher Chedeau", Facebook = "vjeux" }},
59-
{"cpojer", new AuthorModel { Name = "Christoph Pojer", Facebook = "cpojer" }},
60-
{"jordwalke", new AuthorModel { Name = "Jordan Walke", Facebook = "jordwalke" }},
61-
{"zpao", new AuthorModel { Name = "Paul O'Shannessy", Facebook = "zpao" }},
57+
{"daniel", new AuthorModel { Name = "Daniel Lo Nigro", GithubUsername = "Daniel15" }},
58+
{"vjeux", new AuthorModel { Name = "Christopher Chedeau", GithubUsername = "vjeux" }},
59+
{"cpojer", new AuthorModel { Name = "Christoph Pojer", GithubUsername = "cpojer" }},
60+
{"jordwalke", new AuthorModel { Name = "Jordan Walke", GithubUsername = "jordwalke" }},
61+
{"zpao", new AuthorModel { Name = "Paul O'Shannessy", GithubUsername = "zpao" }},
6262
};
6363
_comments = new List<CommentModel>
6464
{

src/React.Sample.Mvc6/Controllers/HomeController.cs

+6-6
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ namespace React.Sample.Mvc6.Models
2121
public class AuthorModel
2222
{
2323
public string Name { get; set; }
24-
public string Facebook { get; set; }
24+
public string GithubUsername { get; set; }
2525
}
2626
public class CommentModel
2727
{
@@ -54,11 +54,11 @@ public HomeController()
5454
// For clarity, we'll just use a hard-coded list.
5555
_authors = new Dictionary<string, AuthorModel>
5656
{
57-
{"daniel", new AuthorModel { Name = "Daniel Lo Nigro", Facebook = "daaniel" }},
58-
{"vjeux", new AuthorModel { Name = "Christopher Chedeau", Facebook = "vjeux" }},
59-
{"cpojer", new AuthorModel { Name = "Christoph Pojer", Facebook = "cpojer" }},
60-
{"jordwalke", new AuthorModel { Name = "Jordan Walke", Facebook = "jordwalke" }},
61-
{"zpao", new AuthorModel { Name = "Paul O'Shannessy", Facebook = "zpao" }},
57+
{"daniel", new AuthorModel { Name = "Daniel Lo Nigro", GithubUsername = "Daniel15" }},
58+
{"vjeux", new AuthorModel { Name = "Christopher Chedeau", GithubUsername = "vjeux" }},
59+
{"cpojer", new AuthorModel { Name = "Christoph Pojer", GithubUsername = "cpojer" }},
60+
{"jordwalke", new AuthorModel { Name = "Jordan Walke", GithubUsername = "jordwalke" }},
61+
{"zpao", new AuthorModel { Name = "Paul O'Shannessy", GithubUsername = "zpao" }},
6262
};
6363
_comments = new List<CommentModel>
6464
{

src/React.Sample.Mvc6/wwwroot/js/Sample.jsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,6 @@ var Avatar = React.createClass({
101101
);
102102
},
103103
getPhotoUrl(author) {
104-
return 'http://graph.facebook.com/' + author.Facebook + '/picture';
104+
return 'https://avatars.githubusercontent.com/' + author.GithubUsername + '?s=50';
105105
}
106106
});

src/React.Sample.Owin/CommentsMiddleware.cs

+6-6
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ namespace React.Sample.Owin.Models
2323
public class AuthorModel
2424
{
2525
public string Name { get; set; }
26-
public string Facebook { get; set; }
26+
public string GithubUsername { get; set; }
2727
}
2828
public class CommentModel
2929
{
@@ -49,11 +49,11 @@ public CommentsMiddleware(Func<IDictionary<string, object>, Task> next)
4949
// For clarity, we'll just use a hard-coded list.
5050
var authors = new Dictionary<string, AuthorModel>
5151
{
52-
{"daniel", new AuthorModel { Name = "Daniel Lo Nigro", Facebook = "daaniel" }},
53-
{"vjeux", new AuthorModel { Name = "Christopher Chedeau", Facebook = "vjeux" }},
54-
{"cpojer", new AuthorModel { Name = "Christoph Pojer", Facebook = "cpojer" }},
55-
{"jordwalke", new AuthorModel { Name = "Jordan Walke", Facebook = "jordwalke" }},
56-
{"zpao", new AuthorModel { Name = "Paul O'Shannessy", Facebook = "zpao" }},
52+
{"daniel", new AuthorModel { Name = "Daniel Lo Nigro", GithubUsername = "Daniel15" }},
53+
{"vjeux", new AuthorModel { Name = "Christopher Chedeau", GithubUsername = "vjeux" }},
54+
{"cpojer", new AuthorModel { Name = "Christoph Pojer", GithubUsername = "cpojer" }},
55+
{"jordwalke", new AuthorModel { Name = "Jordan Walke", GithubUsername = "jordwalke" }},
56+
{"zpao", new AuthorModel { Name = "Paul O'Shannessy", GithubUsername = "zpao" }},
5757
};
5858

5959
_comments = new List<CommentModel>

src/React.Sample.Owin/Content/Sample.jsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,6 @@ var Avatar = React.createClass({
104104
);
105105
},
106106
getPhotoUrl(author) {
107-
return 'http://graph.facebook.com/' + author.Facebook + '/picture';
107+
return 'https://avatars.githubusercontent.com/' + author.GithubUsername + '?s=50';
108108
}
109109
});

src/React.Sample.Webpack/Content/components/Avatar.jsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ var Avatar = React.createClass({
2525
);
2626
},
2727
getPhotoUrl(author) {
28-
return 'http://graph.facebook.com/' + author.Facebook + '/picture';
28+
return 'https://avatars.githubusercontent.com/' + author.GithubUsername + '?s=50';
2929
}
3030
});
3131

0 commit comments

Comments
 (0)