Copy type instead of guessing
All checks were successful
the build was successful

This commit is contained in:
Peter Stuifzand 2018-08-05 14:03:21 +02:00
parent fddea5e39b
commit 207fd8ecd6
Signed by: peter
GPG Key ID: 374322D56E5209E8

View File

@ -137,7 +137,8 @@ func SimplifyMicroformat(item *microformats.Microformat) map[string]interface{}
}
func SimplifyMicroformatData(md *microformats.Data) []map[string]interface{} {
items := []map[string]interface{}{}
var items []map[string]interface{}
for _, item := range md.Items {
if len(item.Type) >= 1 && item.Type[0] == "h-feed" {
for _, childItem := range item.Children {
@ -191,6 +192,10 @@ func MapToItem(result map[string]interface{}) microsub.Item {
item.Type = "entry"
if itemType, e := result["type"]; e {
item.Type = itemType.(string)
}
if name, e := result["name"]; e {
item.Name = name.(string)
}