Need help to create web API for the listing of news.

28 views
Skip to first unread message

Viplav Dube

unread,
Oct 9, 2020, 11:39:43 AM10/9/20
to Django users
Dear all,
Need to write a small scraper for JSON links and get the news on one API call for current date and store it in the table in this format (Id, Date, Title, Details, New From (CNN, Times, etc.) and URL of News).
News can be searched via any keyword in title or in detail field. 

Please share any documents or codes for better reference to build a code.
Thank You in Advance.
Viplav Dube 

Kasper Laudrup

unread,
Oct 9, 2020, 2:18:18 PM10/9/20
to django...@googlegroups.com
Hi Viplay

On 09/10/2020 16.26, Viplav Dube wrote:
> Dear all,
> Need to write a small scraper for JSON links and get the news on one API
> call for current date and store it in the table in this format (Id,
> Date, Title, Details, New From (CNN, Times, etc.) and URL of News).
> News can be searched via any keyword in title or in detail field.
>

You can probably use the requests library
(https://requests.readthedocs.io/en/master/) for the scraping.

Not really sure if you mean you want to call an existing API, in which
case just using requests should be fine, or you actually need to parse
HTML and find links ("scraping") in which case you probably need to
combine it with beatiful soup
(https://www.crummy.com/software/BeautifulSoup/bs4/doc/).

Shouldn't be a problem to create a database model for storing that
information using standard Django models and searching shouldn't be much
of a problem either:

https://docs.djangoproject.com/en/3.1/topics/db/search/

Hope that helps a bit.

Kind regards,

Kasper Laudrup

Viplav Dube

unread,
Oct 10, 2020, 11:34:03 AM10/10/20
to django...@googlegroups.com, lau...@stacktrace.dk
Hi Kasper Laudrup,
Thanks for your reply, I have done scraper part for a single site and performing well. But 
Few points I want to share with you ,for that I need help.
1. Need to create web API for the listing of news and searching news with keywords
2. Need to write a small scraper for below JSON links and get the news on one API call for current

date and store it in the table in this format (Id, Date, Title, Details, New From (CNN, Times,
etc.) and URL of News)
3. You need to ensure that no duplicate news gets entered in the table via scraper
4. News can be searched via any keyword in title or in detail field
5. Also, we will need API to delete any news by passing ID and we need separate API to update
the news details

{
"Washington Post": {
"link": "washingtonpost.com"
},
"CNN": {
"link": "http://edition.cnn.com/"
},
"Time": {
"link": "http://time.com/"
},
"QZ": {
"link": "https://qz.com/"
},
"Slashdot": {
"link": "https://slashdot.org/"
}
}




--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/bb232ec7-672e-633f-1fb6-79c608693870%40stacktrace.dk.

Kasper Laudrup

unread,
Oct 11, 2020, 7:09:21 AM10/11/20
to django...@googlegroups.com
Hi Viplay,

On 10/10/2020 17.31, Viplav Dube wrote:
> Hi Kasper Laudrup,
> Thanks for your reply, I have done scraper part for a single site and
> performing well. But
> Few points I want to share with you ,for that I need help.

Glad to hear you are making progress and hope my input was helpful.

To be honest, I don't really have the time to help you with the more
specific parts at the moment, but maybe someone else can?

Seems like you're moving in the right direction though so I'm sure
you'll figure it out.

Thank you for your understanding.

Kind regards,

Kasper Laudrup

Dvs Khamele

unread,
Oct 11, 2020, 12:59:13 PM10/11/20
to django...@googlegroups.com
Hi do you hire contract based python/django freelancer?
 We can help you in this and related tasks at fair prices
Best Regards, 
Divyesh Khamele,
Pythonmate

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages