ahmdrz / goinsta

Unofficial Instagram API written in Golang
MIT License
895 stars 247 forks source link

Help to implement location in posts #191

Open wilsontamarozzi opened 5 years ago

wilsontamarozzi commented 5 years ago

I need to enter the locations in my posts and I decided to try to implement in GoInsta. But debugging the error output is being complicated because the server returns unknown error.

Looking at the @ mgp25 repository I noticed it would just add a small json snippet with the information.

In the Media file, in the UploadPhoto function I added the following excerpt. The location object I copied from a post already made.

"location": map[string]interface{}{
    "pk": 212928653,
    "name": "Miami Beach, Florida",
    "address": "",
    "city": "",
    "short_name": "Miami Beach",
    "lng": -80.1341,
    "lat": 25.813,
    "external_source": "facebook_places",
    "facebook_places_id": 108260802527498,
},
"lat": 25.813,
"lng": -80.1341,

Staying like this:

config := map[string]interface{}{
        "media_folder": "Instagram",
        "source_type":  4,
        "caption":      photoCaption,
        "upload_id":    strconv.FormatInt(uploadID, 10),
        "device":       goInstaDeviceSettings,
        "edits": map[string]interface{}{
            "crop_original_size": []int{width * 1.0, height * 1.0},
            "crop_center":        []float32{0.0, 0.0},
            "crop_zoom":          1.0,
            "filter_type":        filterType,
        },
        "extra": map[string]interface{}{
            "source_width":  width,
            "source_height": height,
        },

        "location": map[string]interface{}{
            "pk": 212928653,
            "name": "Miami Beach, Florida",
            "address": "",
            "city": "",
            "short_name": "Miami Beach",
            "lng": -80.1341,
            "lat": 25.813,
            "external_source": "facebook_places",
            "facebook_places_id": 108260802527498,
        },
        "lat": 25.813,
        "lng": -80.1341,
    }

The error I'm having is: fail: Unknown Server Error. ()

Anyone have any idea how to implement the locations in the posts?

ahmdrz commented 5 years ago

Hi, Sorry for late answering. Did you find any solution ?

wilsontamarozzi commented 5 years ago

I ended up paying attention to other resources and I ended up leaving aside, although it is still a necessity.

I even tried a few ways, but I did not succeed.

ahmdrz commented 5 years ago

Sorry I was busy. I'll try to implement it.

ChrisJSt commented 5 years ago

Any update on getting recent posts from location feed as opposed to ranked content? Would be extremely helpful