Fix useless bare-divar.ir links + hide empty homepage shifts section
- Divar listings with no extractable post token were given SourceUrl «https://divar.ir» — a link that just opens Divar''s homepage, not the ad. Store null instead, and guard the contact-modal fallback to require a real path (so existing bare-domain links stop being offered too). - Homepage «جدیدترین شیفتها»: only render when there are real open shifts. Almost all aggregated ads are ongoing hiring (jobs), not dated shifts, so the section was showing a fabricated shift date (the «۱۸ خرداد» on the welcome page). Now it hides when empty. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -62,7 +62,9 @@ public class DivarListingSource : IListingSource
|
||||
var cityLabel = CityLabel(s.DivarCity); // every result is from the city we searched
|
||||
foreach (var (text, token) in Harvest(doc.RootElement).Take(25))
|
||||
{
|
||||
var url = token is not null ? $"https://divar.ir/v/{token}" : "https://divar.ir";
|
||||
// Only a real post token gives a usable deep link. Without one, leave SourceUrl null —
|
||||
// a bare «https://divar.ir» just opens Divar's homepage, which is useless to the user.
|
||||
var url = token is not null ? $"https://divar.ir/v/{token}" : null;
|
||||
var itemText = text;
|
||||
// Stamp the city so the parser/AI always resolve a location (Divar's own location
|
||||
// line isn't always in the search row; the searched city is authoritative).
|
||||
|
||||
Reference in New Issue
Block a user