mirror of
https://github.com/httpjamesm/AnonymousOverflow.git
synced 2025-05-14 05:52:54 +00:00
feat: get stackexchange posts
fix: comment author distinguishing
This commit is contained in:
parent
f81b726612
commit
45644a0503
2 changed files with 19 additions and 2 deletions
|
@ -53,7 +53,15 @@ func ViewQuestion(c *gin.Context) {
|
|||
soSortValue = soSortValues["votes"]
|
||||
}
|
||||
|
||||
soLink := fmt.Sprintf("https://stackoverflow.com/questions/%s/%s?answertab=%s", questionId, questionTitle, soSortValue)
|
||||
sub := c.Param("sub")
|
||||
|
||||
domain := "stackoverflow.com"
|
||||
|
||||
if sub != "" {
|
||||
domain = fmt.Sprintf("%s.stackexchange.com", sub)
|
||||
}
|
||||
|
||||
soLink := fmt.Sprintf("https://%s/questions/%s/%s?answertab=%s", domain, questionId, questionTitle, soSortValue)
|
||||
|
||||
resp, err := client.R().Get(soLink)
|
||||
if err != nil {
|
||||
|
@ -218,7 +226,7 @@ func ViewQuestion(c *gin.Context) {
|
|||
answerTimestamp := ""
|
||||
|
||||
answerFooter.Find("div.post-signature").Each(func(i int, s *goquery.Selection) {
|
||||
questionAuthorDetails := questionMetadata.Find("div.user-details")
|
||||
questionAuthorDetails := s.Find("div.user-details")
|
||||
|
||||
if questionAuthorDetails.Length() > 0 {
|
||||
questionAuthor := questionAuthorDetails.Find("a").First()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue