Skip to content
This repository has been archived by the owner on Aug 25, 2023. It is now read-only.

How to use Import and Export functions ? #65

Closed
skawm opened this issue Jul 28, 2017 · 5 comments
Closed

How to use Import and Export functions ? #65

skawm opened this issue Jul 28, 2017 · 5 comments

Comments

@skawm
Copy link

skawm commented Jul 28, 2017

hello, I am a beginner in Golang programming, I don't understand how to use exactly the Import and Export functions. Can you say me how ? (may I keep the bytes in a file?)
Thanks

@skawm skawm closed this as completed Jul 28, 2017
@skawm
Copy link
Author

skawm commented Jul 28, 2017

I thinked I found , but, I didnt found .. If you can help it will be very cool :)

@skawm skawm reopened this Jul 28, 2017
@ahmdrz
Copy link
Owner

ahmdrz commented Jul 29, 2017

Hi @skawm ,

package main

import (
	"fmt"

	"github.com/ahmdrz/goinsta"
)

func main() {
	insta := goinsta.New("USERNAME", "PASSWORD")

	if err := insta.Login(); err != nil {
		panic(err)
	}

	defer insta.Logout()

	bytes, err := insta.Export([]byte("32Byte AES Key"))
	if err != nil {
		panic(err)
	}

        ioutil.WriteFile("insta.bak", bytes, 755)
}

And for import ,

  1. Read bytes using ioutil.ReadFile()
  2. Pass bytes to Import function.

@skawm
Copy link
Author

skawm commented Jul 30, 2017

Hi @ahmdrz ! Thank you! it seems to work super-fine:)

@skawm skawm closed this as completed Jul 30, 2017
@herhumoolah
Copy link

I can't export! help me

inst.Export("~/.goinsta") this does nothing

@ahmdrz
Copy link
Owner

ahmdrz commented Apr 19, 2019

@herhumoolah Let me know more about your code.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants