> ## Documentation Index
> Fetch the complete documentation index at: https://www.diadata.org/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Add a New Foreign Scraper

Implement `ForeignScrapperer` interface at `pkg/dia/scraper/foreign-scrapers/Scrapper.go` file

```js theme={"system"}
type ForeignScrapperer interface {
	UpdateQuotation() error
	GetQuoteChannel() chan *models.ForeignQuotation
}
```

Add the scraper implementation a `MyForeignScraper.go` Golang file to `pkg/dia/scraper/foreign-scrapers/` folder and add the next implementations:

```js theme={"system"}
func (scraper *MyForeignScraper) Pool() chan dia.Pool {}
func (scraper *MyForeignScraper) Done() chan bool {}
```

<Steps>
  <Step>
    Add a constructor for the scraper:

    ```js theme={"system"}
    func NewMyForeignScraper(exchange dia.Exchange) *MyForeignScraper {}
    ```
  </Step>

  <Step>
    Add `MyForeignScraper` case at scraper file `cmd/foreignscraper/foreign.go`:

    ```js theme={"system"}
    switch *scraperType {
    	case "MyForeignScraper":
    		log.Println("Start scraping data")
    		sc = scrapers.NewMyForeignScraper(ds)
    }
    ```
  </Step>
</Steps>

## Foreign Command

```js theme={"system"}
go mod tidy -go=1.16 && go mod tidy -go=1.17 && go install && foreignscraper -foreignType=ForeignType
```

## Foreign Test

```js theme={"system"}
go mod tidy -go=1.16 && go mod tidy -go=1.17 && go install && foreignscraper -foreignType=FOREIGN_TYPE
```
