We should add validation to the block configuration which would check if the Instagram username is valid.

If we put in an invalid username, it saves successfully but then fails on page display. Since we already have Check on configuration block if profile is public or private, I think this could be an addition to the validation we created there.

Comments

boshtian created an issue. See original summary.

vdenis’s picture

Added check if entered Instagram username even exists. Please take a look and review it.

vdenis’s picture

Status: Active » Needs review
deaom’s picture

Status: Needs review » Needs work

I can not apply patch in my local drupal environment and also on the simply test me site.

deaom’s picture

Status: Needs work » Needs review

Because this patch is related to the #3021391: Check on configuration block if profile is public or private and if profile exists, you first need to apply that patch and then this one. The patch then applies and works. Tested through simplytest.me site. On my local environment I still can't apply the patch, so I'm marking this as needs review, so somebody else can also test it and confirm that everything works as designed.

ngkoutsaik’s picture

Status: Needs review » Reviewed & tested by the community

Hi,

thanks for the patch and review. I reviewed the patch and on its own, it does not work, but as said by @DeaOm it works if you apply the patch from the other issue it works.

I would mark this as RTBC since it does what it needs. And as already mentioned these issues are part of the same problem.

ipwa’s picture

Version: 8.x-1.0 » 8.x-2.x-dev

Targeting correct branch now that branches have been fixed.

ipwa’s picture

Status: Reviewed & tested by the community » Needs work

Patch needs be re-rolled to 8.x-2.x

tmaiochi’s picture

Assigned: Unassigned » tmaiochi

I'll re-roll the patch!

tmaiochi’s picture

@ipwa Hey, I was doing the re-roll, but I realized that what this issue propose to do already have. I tried to put a invalid Instagram username and the block don't showed to me, I don't know how it worked before, but I think it's already fixed, Am I right?

tmaiochi’s picture

Assigned: tmaiochi » Unassigned

i talked to @ipwa about this issue so I'm unassigned so he can look at it again

alanmoreira’s picture

Assigned: Unassigned » alanmoreira

I'll work on this :)

alanmoreira’s picture

Assigned: alanmoreira » Unassigned

I installed the module and placed the block but it did not rendered in HTML. I tried in Drupal 8 and 9 versions. Leaving this "Unassigned".

Joel Guerreiro Borghi Filho’s picture

Assigned: Unassigned » Joel Guerreiro Borghi Filho

Hi, I will try to work on this. =)

Joel Guerreiro Borghi Filho’s picture

Assigned: Joel Guerreiro Borghi Filho » Unassigned

I did the following:

0. Installed a backward compatibility module.
1. Installed the module.
2. Added a valid instagram username.
3. Placed the block on the footer.
4. The block did not show.

I added an invalid instagram username and it does not show either.

After that I tried applying the patch, which did not work.

So I followed comment #5 and created a branch with the date of comment #14 of the other related issue.
This way the patch from #14 applies and the patch from #2 of this issue as well.

After applying both patches the validation prevents any username, valid or invalid from being entered and displays an error message about
the invalid username.

After that I tried rerolling the patch, but without much success.
There are conflicts when trying to rebase for a reroll that I could not fix.

elber’s picture

Hi I wll try to do a reroll.

elber’s picture

Assigned: Unassigned » elber
elber’s picture

Assigned: elber » Unassigned
Status: Needs work » Needs review
StatusFileSize
new1.32 KB
elber’s picture

elber’s picture

StatusFileSize
new8.11 KB

Sorry it's the right file.

alanmoreira’s picture

Assigned: Unassigned » alanmoreira

I'll review this :)

alanmoreira’s picture

Assigned: alanmoreira » Unassigned

I was able to apply the #20 patch, but the module is still not working properly. The method JsonService::retrieveJson always returns 'null', what makes the validation of the username always throws an error message. I'm leaving it unassigned.

mpaulo’s picture

It seems that Instagram has removed the window._sharedData object from the document returned from the GET `/{username}` resource, making it impossible for most of the data necessary for this project to be retrieved.

I'll try to work on this, over the patch #20.

mpaulo’s picture

Assigned: Unassigned » mpaulo
mpaulo’s picture

It seems that Instagram has been blocking the known workarounds to access to users posts without the need of public APIs.

Any documented endpoints available requires authentication, and the known methods to gather user posts (i.e., the one used by this project), seems to either have been ended by them, or it sits around a very restrictive firewall.

This project relies on the existence of such methods, that can be deprecated at any moment, without notice.

#Instagram Without API

It is a very simple module that integrates with Instagram without API and creates a block containing your most recent Instagram posts.

I searched how other projects scrapped this information from Instagram without the need to authenticate, and the most reliable method seems to consume the web application by a browser, like using a headless browser automation process.

Here are some materials I've found about the issue:
https://www.reddit.com/r/webscraping/comments/uxt2ns/instagram_doesnt_sh...
https://scrapfly.io/blog/how-to-scrape-instagram/#scraping-user-posts

mpaulo’s picture

Assigned: mpaulo » Unassigned

Forgot to unassign me from the issue.

ipwa’s picture

Assigned: Unassigned » ipwa
Status: Needs review » Fixed

Fixed as part of #3021391

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

ipwa’s picture

Version: 8.x-2.x-dev » 3.0.x-dev

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.