Skip to content

Commit

Permalink
fix instagram barrel + desktop widths
Browse files Browse the repository at this point in the history
  • Loading branch information
mrWh1te committed Apr 21, 2021
1 parent c6c48f8 commit 1bb45e3
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 10 deletions.
39 changes: 33 additions & 6 deletions apps/bot-instagram/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@ import {
viewStories,
isSaveYourLoginInfoActive,
clickSaveYourLoginInfoNoButton,
logout
logout,
goToExplore,
goToMessaging,
goToSettings
} from '@botmation/instagram'

(async () => {
Expand All @@ -34,6 +37,15 @@ import {
const pages = await browser.pages()
const page = pages.length === 0 ? await browser.newPage() : pages[0]

// Instagram BotActions were developed for the UI responsiveness in desktop widths
// specifically, in mobile widths, the `viewStories` BotAction will open your story
// instead of the presentation of stories
await page.setViewport({
width: 1000,
height: 600,
deviceScaleFactor: 1,
});

await chain(
log('Botmation running'),

Expand All @@ -54,10 +66,11 @@ import {

// lets log in, if we are a guest
givenThat(isGuest) (
login({username: 'account', password: 'password'}), // <- put your username and password here
login({username: 'lagmahol', password: 'jesu1t2007!'}), // <- put your username and password here
files()(
saveCookies('instagram'), // the Bot will skip login, on next run, by loading cookies
)
),

),

// in case that log in failed, lets check before we operate as a logged in user
Expand All @@ -76,18 +89,32 @@ import {

screenshot('logged-in'),

viewStories,
// viewStories,
log('screenshot taken'),

wait(12000),

goToExplore,

wait(2000),

goToMessaging,

wait(2000),

goToSettings,


wait(5000),

logout,
// logout,

log('logout complete'),
// log('logout complete'),

wait(15000)
),


log('Done'),
)(page)

Expand Down
5 changes: 1 addition & 4 deletions libs/instagram/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,4 @@ export * from './lib/actions/stories'

export * from './lib/constants/modals'
export * from './lib/constants/urls'

export * from './lib/helpers/urls'

export * from './lib/selectors'
export * from './lib/constants/selectors'

0 comments on commit 1bb45e3

Please sign in to comment.